[clang] [clang][bytecode][NFC] Check for custom typechecking in call cleanup (PR #106826)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 30 22:26:34 PDT 2024
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/106826
The comment already explains that this is only true for _some_ builtin functions. This also brings the time it takes me to run the builtin-functions.cpp test locally from 50s down to 47s.
>From e38266cd0fa28e9c314b3cedb108d0a3ee3dcaa0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Sat, 31 Aug 2024 07:20:26 +0200
Subject: [PATCH] [clang][bytecode][NFC] Check for custom typechecking in call
cleanup
The comment already explains that this is only true for _some_ builtin
functions. This also brings the time it takes me to run the
builtin-functions.cpp test locally from 50s down to 47s.
---
clang/lib/AST/ByteCode/Interp.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 42012767c22332..c4f76a3cc03aae 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -226,7 +226,8 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC) {
// Some builtin functions require us to only look at the call site, since
// the classified parameter types do not match.
- if (CurFunc->isBuiltin()) {
+ if (unsigned BID = CurFunc->getBuiltinID();
+ BID && S.getASTContext().BuiltinInfo.hasCustomTypechecking(BID)) {
const auto *CE =
cast<CallExpr>(S.Current->Caller->getExpr(S.Current->getRetPC()));
for (int32_t I = CE->getNumArgs() - 1; I >= 0; --I) {
More information about the cfe-commits
mailing list