[clang] [clang][bytecode] Implement __builtin_constant_p differently (PR #122099)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 07:08:55 PST 2025


tbaederr wrote:

>    - We check whether two pointers are in the same range
>
> Is that possible to implement in the interpreter without going back to AST visitors?

I take "in the same range" meaning as "can be compared at compile time at all" here, so yes, that would be rather trivial (we have to do the check already anyway of course).

Note that of the two use cases you mentioned here, neither works with the code in this PR. :(

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


More information about the cfe-commits mailing list