[clang] 051fade - [clang][Interp][NFC] Use delegate() address-of operators

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 01:43:45 PDT 2023


Author: Timm Bäder
Date: 2023-10-27T10:43:35+02:00
New Revision: 051fade10f03515b0980c58541fe4c28220e0e67

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

LOG: [clang][Interp][NFC] Use delegate() address-of operators

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index a5141d728d8322e..195af664c13dafc 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -2549,9 +2549,7 @@ bool ByteCodeExprGen<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
     return DiscardResult ? this->emitPop(*T, E) : true;
   case UO_AddrOf: // &x
     // We should already have a pointer when we get here.
-    if (!this->visit(SubExpr))
-      return false;
-    return DiscardResult ? this->emitPop(*T, E) : true;
+    return this->delegate(SubExpr);
   case UO_Deref:  // *x
     return dereference(
         SubExpr, DerefKind::Read,


        


More information about the cfe-commits mailing list