================
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const
CallExpr *E,
BuiltinOp != Builtin::BI__lzcnt &&
BuiltinOp != Builtin::BI__lzcnt64;
- if (ZeroIsUndefined && !Val)
- return Error(E);
+ if (!Val) {
+ if (BuiltinOp == Builtin::BI__builtin_clzg && E->getNumArgs() > 1) {
+ APSInt Fallback;
+ if (!EvaluateInteger(E->getArg(1), Fallback, Info))
+ return false;
+ return Success(Fallback, E);
+ }
+
+ if (ZeroIsUndefined)
----------------
nickdesaulniers wrote:
Sink the definition of `ZeroIsUndefined` closer to the use to reduce its scope.
We might not need to evaluate that expression.
https://github.com/llvm/llvm-project/pull/86577
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits