[clang] e16901c - [clang][bytecode] Use IsNonNull opcode in CXXNewExpr (#221515)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 5 22:27:13 PDT 2026


Author: Timm Baeder
Date: 2026-09-06T07:27:08+02:00
New Revision: e16901ce359a3162aa1c1d071a73392077e22744

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

LOG: [clang][bytecode] Use IsNonNull opcode in CXXNewExpr (#221515)

Instead of emitting a null pointer and checking that for equality.

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 c99f2affc6824..a541d9b255e54 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4340,11 +4340,9 @@ bool Compiler<Emitter>::VisitCXXNewExpr(const CXXNewExpr *E) {
         if (IsNoThrow) {
           if (!this->emitDupPtr(E))
             return false;
-          if (!this->emitNullPtr(0, nullptr, E))
+          if (!this->emitIsNonNullPtr(E))
             return false;
-          if (!this->emitEQPtr(E))
-            return false;
-          if (!this->jumpTrue(EndLabel, E))
+          if (!this->jumpFalse(EndLabel, E))
             return false;
         }
 


        


More information about the cfe-commits mailing list