[cfe-commits] r89769 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CGExpr.cpp CodeGenFunction.h

Douglas Gregor dgregor at apple.com
Tue Nov 24 08:21:10 PST 2009


Author: dgregor
Date: Tue Nov 24 10:21:10 2009
New Revision: 89769

URL: http://llvm.org/viewvc/llvm-project?rev=89769&view=rev
Log:
Rename CleanupScope -> DelayedCleanupBlock. No functionality change.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=89769&r1=89768&r2=89769&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Nov 24 10:21:10 2009
@@ -376,7 +376,7 @@
 
       {
         // Push a cleanup block and restore the stack there.
-        CleanupScope scope(*this);
+        DelayedCleanupBlock scope(*this);
 
         V = Builder.CreateLoad(Stack, "tmp");
         llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::stackrestore);
@@ -521,7 +521,7 @@
         
         if (const ConstantArrayType *Array = 
               getContext().getAsConstantArrayType(Ty)) {
-          CleanupScope Scope(*this);
+          DelayedCleanupBlock Scope(*this);
           QualType BaseElementTy = getContext().getBaseElementType(Array);
           const llvm::Type *BasePtr = ConvertType(BaseElementTy);
           BasePtr = llvm::PointerType::getUnqual(BasePtr);
@@ -532,7 +532,7 @@
           // Make sure to jump to the exit block.
           EmitBranch(Scope.getCleanupExitBlock());
         } else {
-          CleanupScope Scope(*this);
+          DelayedCleanupBlock Scope(*this);
           EmitCXXDestructorCall(D, Dtor_Complete, DeclPtr);
         }
       }
@@ -545,7 +545,7 @@
     llvm::Constant* F = CGM.GetAddrOfFunction(FD);
     assert(F && "Could not find function!");
 
-    CleanupScope scope(*this);
+    DelayedCleanupBlock scope(*this);
 
     const CGFunctionInfo &Info = CGM.getTypes().getFunctionInfo(FD);
 
@@ -566,7 +566,7 @@
   }
 
   if (needsDispose && CGM.getLangOptions().getGCMode() != LangOptions::GCOnly) {
-    CleanupScope scope(*this);
+    DelayedCleanupBlock scope(*this);
     llvm::Value *V = Builder.CreateStructGEP(DeclPtr, 1, "forwarding");
     V = Builder.CreateLoad(V, false);
     BuildBlockRelease(V);

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=89769&r1=89768&r2=89769&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Nov 24 10:21:10 2009
@@ -137,7 +137,7 @@
             const CXXDestructorDecl *Dtor =
               ClassDecl->getDestructor(getContext());
 
-            CleanupScope scope(*this);
+            DelayedCleanupBlock scope(*this);
             EmitCXXDestructorCall(Dtor, Dtor_Complete, Val.getAggregateAddr());
           }
         }

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=89769&r1=89768&r2=89769&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Nov 24 10:21:10 2009
@@ -133,17 +133,17 @@
   /// block.
   CleanupBlockInfo PopCleanupBlock();
 
-  /// CleanupScope - RAII object that will create a cleanup block and set the
+  /// DelayedCleanupBlock - RAII object that will create a cleanup block and set the
   /// insert point to that block. When destructed, it sets the insert point to
   /// the previous block and pushes a new cleanup entry on the stack.
-  class CleanupScope {
+  class DelayedCleanupBlock {
     CodeGenFunction& CGF;
     llvm::BasicBlock *CurBB;
     llvm::BasicBlock *CleanupEntryBB;
     llvm::BasicBlock *CleanupExitBB;
     
   public:
-    CleanupScope(CodeGenFunction &cgf)
+    DelayedCleanupBlock(CodeGenFunction &cgf)
       : CGF(cgf), CurBB(CGF.Builder.GetInsertBlock()),
       CleanupEntryBB(CGF.createBasicBlock("cleanup")), CleanupExitBB(0) {
       CGF.Builder.SetInsertPoint(CleanupEntryBB);
@@ -155,7 +155,7 @@
       return CleanupExitBB;
     }
     
-    ~CleanupScope() {
+    ~DelayedCleanupBlock() {
       CGF.PushCleanupBlock(CleanupEntryBB, CleanupExitBB);
       // FIXME: This is silly, move this into the builder.
       if (CurBB)





More information about the cfe-commits mailing list