[clang] [llvm] [clang][builtin] Implement __builtin_allow_runtime_check (PR #87568)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 16:14:08 PDT 2024


================
@@ -3464,6 +3464,34 @@ Query for this feature with ``__has_builtin(__builtin_trap)``.
 
 ``__builtin_arm_trap`` is lowered to the ``llvm.aarch64.break`` builtin, and then to ``brk #payload``.
 
+``__builtin_allow_runtime_check``
----------------
vitalybuka wrote:

Similar __builtin_cpu_is, also works only with literals.

The closest thing I see is c++26 `static_assert` https://en.cppreference.com/w/cpp/language/static_assert
And it's parsed in a weird way `EvaluateStaticAssertMessageAsString`
https://godbolt.org/z/Gcf74Ysjs

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


More information about the cfe-commits mailing list