Artem-B wrote:

I think the conceptual problem here is that `__has_builtin()` conflates 
"builtin exists" with "builtin is usable on the target". For C++ they are the 
same. For CUDA they are not. Builting in aux-triple do exist (as in compiler 
does see them when it constructs AST), but we can't generate code for them.

Considering that `__has_builtin` is a preprocessor entity and applies to all 
source code, it can never mean `is it usable` and can only indicate that the 
builtin is visible to the compiler. It can never tall whether the builtin is 
usable because for CUDA it would require the caller context, which preprocessor 
does not have.

I think this patch should be reverted.

https://github.com/llvm/llvm-project/pull/121839
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to