[clang] [Clang][WIP] Constant Expressions inside of gcc'asm strings (PR #131003)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 12 11:24:57 PDT 2025


cor3ntin wrote:

@ojhunt @erichkeane @AaronBallman  I'm looking for early feedback at this point. Obviously this has no tests yes

This 
 - Generalize our ability to evaluate string expression outside of static assert (which will be otherwise useful for https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3423r1.html )
 - Implement GCC's constexpr string in ASM
 - Once strings are evaluated, they are cached in a ConstantExpr (but we still need to go from APValue -> std::string everytime, which seems reasonable
 - Because the strings can be arbitrary expressions they can be dependent.  If any string is a dependent expression all of sema is skipped until instantiation. It's a slightly big hammer but honestly I'm not sure that we can improve or that it would be worth it.

- [ ] Tests
- [ ] Doc / Changelog
- [ ] cxx_features




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


More information about the cfe-commits mailing list