xen0n added inline comments.
================ Comment at: clang/lib/Driver/ToolChains/Arch/LoongArch.cpp:199-204 + // Handle CPU name is 'native'. + if (CPU == "native") { + CPU = llvm::sys::getHostCPUName(); + if (CPU == "generic") + CPU = llvm::LoongArch::getDefaultArch(Triple.isLoongArch64()); + } ---------------- This part is identical between `-march=` and `-mtune=` handling. I'd suggest extracting out a common helper for this, or making this function generic over `options::OPT_m*_EQ` (whichever more suitable for you and the Clang maintainers; I don't have a particular preference). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155824/new/ https://reviews.llvm.org/D155824 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits