================
@@ -20055,6 +20055,46 @@ class VoidExprEvaluator
// The argument is not evaluated!
return true;
+ case Builtin::BI__builtin_assume_dereferenceable: {
+ assert(E->getType()->isVoidType());
+ assert(E->getNumArgs() == 2);
+
+ APSInt ReqSizeVal;
+ if (!::EvaluateInteger(E->getArg(1), ReqSizeVal, Info))
+ return false;
+ if (ReqSizeVal.isZero())
+ return true;
+
+ LValue Pointer;
+ if (!EvaluatePointer(E->getArg(0), Pointer, Info)) {
+ if (EvaluateBuiltinConstantP(Info, E->getArg(0)))
----------------
shafik wrote:
and does this line have a test.
https://github.com/llvm/llvm-project/pull/169869
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits