================
@@ -3233,6 +3233,17 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, 
unsigned BuiltinID,
     if (BuiltinCountZeroBitsGeneric(*this, TheCall))
       return ExprError();
     break;
+
+  case Builtin::BI__builtin_allow_runtime_check: {
+    Expr *Arg = TheCall->getArg(0);
+    // Check if the argument is a string literal.
+    if (!isa<StringLiteral>(Arg->IgnoreParenImpCasts())) {
----------------
vitalybuka wrote:

My interest is in using this feature to implement `assert` like macros which 
will be enabled in cold code, and optimized out in hot.  E.g. MY_ASSERT1, 
MY_ASSERT2... 
Each macro can provide own kind as literal. Number of different kinds is 
supposed to be limited. So literal looks enough for me.
We can relax in the future, restricting could be harder.

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

Reply via email to