[clang] [clang][Driver] Fix triple config loading for clang-cl (PR #111397)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 12 04:34:42 PST 2024
================
@@ -1286,6 +1299,16 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
appendOneArg(Args, Opt, nullptr);
}
}
+
+ // The config file may have changed the architecture so apply it.
+ if (HasConfigFile && Args.hasArg(options::OPT__SLASH_arm64EC)) {
+ llvm::Triple T(TargetTriple);
+ if (T.getArch() != llvm::Triple::aarch64 ||
+ T.getSubArch() != llvm::Triple::AArch64SubArch_arm64ec) {
+ T.setArch(llvm::Triple::aarch64, llvm::Triple::AArch64SubArch_arm64ec);
+ TargetTriple = T.str();
----------------
zmodem wrote:
The PR description only mentions moving the default triple calculation earlier, but not this part.
The config file can presumably change many things, so why does the target triple need special handling? Also what about flags that affect x86 vs. x86_64 (-m32 and -m64), do we need to handle those too?
https://github.com/llvm/llvm-project/pull/111397
More information about the cfe-commits
mailing list