Author: Timm Baeder
Date: 2026-08-24T16:40:04+02:00
New Revision: e43dcc851cbfacd38e2c2f13d7728925f19eafec

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

LOG: [clang][bytecode] Avoid classifying the same expression three times 
(#218403)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index f40d736e225ac..a6378cdf63243 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -1534,13 +1534,14 @@ bool Compiler<Emitter>::VisitPointerArithBinOp(const 
BinaryOperator *E) {
     return false;
   }
 
-  if (classifyPrim(E) != PT_Ptr) {
-    if (!this->emitDecayPtr(PT_Ptr, classifyPrim(E), E))
+  PrimType ExprT = classifyPrim(E);
+  if (ExprT != PT_Ptr) {
+    if (!this->emitDecayPtr(PT_Ptr, ExprT, E))
       return false;
   }
 
   if (DiscardResult)
-    return this->emitPop(classifyPrim(E), E);
+    return this->emitPop(ExprT, E);
   return true;
 }
 


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to