jhuber6 wrote:

> This is/was my concern. However, upon thinking further, as long as we 
> RECOGNIZE/Parse/etc the builtins, it is OK I think if we report 
> "!__has_builtin".
> 
> That is:
> 
> ```
> void foo() {
> #if __has_builtin(__builtin_x86_thing)
> __builtin_x86_thing();
> #else
> __builtin_x86_thing(); // woops, not has_builtin!
> #endif
> }
> ```
> 
> NEEDS to still work, even if the `__has_builtin` answer is 'no'.

Yes, I think that makes sense as it would allow both sides to parse the same 
code without forcing the compiler to always emit an incompatible builtin call. 
Since we already allow users to split compilations with preprocessor values I 
think that's reasonable.

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