[clang] e4cf0a0 - [clang][bytecode][NFC] Check for custom typechecking in call cleanup (#106826)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 23:06:09 PDT 2024


Author: Timm Baeder
Date: 2024-08-31T08:06:06+02:00
New Revision: e4cf0a047d30fcd6cf606af0764883ca896a5153

URL: https://github.com/llvm/llvm-project/commit/e4cf0a047d30fcd6cf606af0764883ca896a5153
DIFF: https://github.com/llvm/llvm-project/commit/e4cf0a047d30fcd6cf606af0764883ca896a5153.diff

LOG: [clang][bytecode][NFC] Check for custom typechecking in call cleanup (#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.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Interp.cpp

Removed: 
    


################################################################################
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