Skip to content

Commit 227f954

Browse files
authored
[clang][bytecode][NFC] Bail out on non constant evaluated builtins (llvm#130431)
If the ASTContext says so, don't bother trying to constant evaluate the given builtin.
1 parent 735afc8 commit 227f954

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,9 @@ static bool interp__builtin_memchr(InterpState &S, CodePtr OpPC,
20592059

20602060
bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F,
20612061
const CallExpr *Call, uint32_t BuiltinID) {
2062+
if (!S.getASTContext().BuiltinInfo.isConstantEvaluated(BuiltinID))
2063+
return false;
2064+
20622065
const InterpFrame *Frame = S.Current;
20632066

20642067
std::optional<PrimType> ReturnT = S.getContext().classify(Call);

0 commit comments

Comments
 (0)