jhuber6 wrote:

> > why there's a __has_builtin that's different from __can_use_builtin (or 
> > whatever we name it), and I don't know that any of us have an answer for 
> > that
> 
> my $.02 IMO it's a side effect of heterogeneous compilation, where compiler 
> has to parse source code for multiple targets (and thus has to see each 
> target's builtins), but can generate code only for the target we're currently 
> compiling for. `__can_use_builtin` will give us a way to distinguish the two. 
> It's not a perfect tool, because usability of a builtin depends on the 
> context, but it's better than nothing.
> 
> For the classic compilation, `__has_builtin` is unambiguous.

Sometimes I wonder if we should have a single way to detect if we're doing any 
kind of offloading so we can guard stuff like this.

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

Reply via email to