[clang] [Clang] Add __has_target_builtin macro (PR #126324)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 19 09:00:19 PST 2025
================
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
// usual allocation and deallocation functions. Required by libc++
return 201802;
default:
+ // __has_target_builtin should return false for aux builtins.
+ if (IsHasTargetBuiltin &&
+ getBuiltinInfo().isAuxBuiltinID(BuiltinID))
----------------
erichkeane wrote:
This logic doesn't seem right to me. What happens if this builtin is supported on BOTH the host and device here? Shouldn't we still return 'true'?
https://github.com/llvm/llvm-project/pull/126324
More information about the cfe-commits
mailing list