[clang] [Clang] Add __has_target_builtin macro (PR #126324)

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 07:05:07 PST 2025


================
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() {
   Ident__has_builtin = RegisterBuiltinMacro("__has_builtin");
   Ident__has_constexpr_builtin =
       RegisterBuiltinMacro("__has_constexpr_builtin");
+  Ident__has_target_builtin = RegisterBuiltinMacro("__has_target_builtin");
----------------
sarnex wrote:

made it unconditional again in the latest commit

i kept the code example in langref because probably we still want to recommend only using this for offloading targets, even though it will work on non-offloading targets. let met know if you disagree.

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


More information about the cfe-commits mailing list