[clang] [clang][AMDGPU] Don't define feature macros on host code (PR #83558)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 03:47:07 PST 2024


================
@@ -292,8 +292,14 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
   }
 
   Builder.defineMacro(Twine("__") + Twine(CanonName) + Twine("__"));
+
+  // Don't emit feature macros in host code because in such cases the
+  // feature list is not accurate.
+  if (IsHIPHost)
----------------
arsenm wrote:

This should apply to all hosts, not just hip 

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


More information about the cfe-commits mailing list