[clang] Frontend: sink vendor definitions from Basic to Frontend (PR #80364)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 16:05:15 PST 2024


================
@@ -804,6 +804,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
     }
   }
 
+  if (TI.getTriple().getVendor() == Triple::AMD)
+    Builder.defineMacro("__AMD__");
+  if (TI.getTriple().getVendor() == Triple::Apple)
+    Builder.defineMacro("__APPLE__");
----------------
compnerd wrote:

Yes, and something that I think that is desirable in the context of Swift as well (where we are looking at some of the embedded system usage where the target triple may be something like `arm64-apple-none-macho`).

https://github.com/llvm/llvm-project/pull/80364


More information about the cfe-commits mailing list