[clang] [clang] constexpr built-in abs function. (PR #112539)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 17 06:15:19 PDT 2024
================
@@ -563,6 +563,19 @@ static bool interp__builtin_fabs(InterpState &S, CodePtr OpPC,
return true;
}
+static bool interp__builtin_abs(InterpState &S, CodePtr OpPC,
+ const InterpFrame *Frame, const Function *Func,
+ const CallExpr *Call) {
+ PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
+ APSInt Val = peekToAPSInt(S.Stk, ArgT);
+ if (Val == APSInt(APSInt::getSignedMinValue(Val.getBitWidth()), false))
----------------
c8ef wrote:
Done.
https://github.com/llvm/llvm-project/pull/112539
More information about the cfe-commits
mailing list