================
@@ -3587,6 +3587,30 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl,
unsigned BuiltinID,
}
break;
}
+
+ case Builtin::BI__builtin_allow_sanitize_check: {
+ Expr *Arg = TheCall->getArg(0);
+ // Check if the argument is a string literal.
+ const StringLiteral *SanitizerName =
+ dyn_cast<StringLiteral>(Arg->IgnoreParenImpCasts());
----------------
melver wrote:
I fear that GCC folks won't like that, as it's a bit too magical, because that
builtin will have too many different semantics depending on its inputs (we
really want GCC to implement it too, otherwise it's unlikely this will get
used).
Currently `__builtin_allow_runtime_check()` semantics is only for denoting
checking in hot/cold code. If we expand its semantics to depend on sanitizer
names, I think it will become too complex. In general I was also hesitating
using strings to disambiguate or introduce one builtin per sanitizer, but
keeping the precedent of mapping the strings to `no_sanitize(string)` is
probably good here.
https://github.com/llvm/llvm-project/pull/172030
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits