[cfe-commits] r103142 - /cfe/trunk/lib/CodeGen/CGObjC.cpp

Chandler Carruth chandlerc at gmail.com
Wed May 5 17:20:39 PDT 2010


Author: chandlerc
Date: Wed May  5 19:20:39 2010
New Revision: 103142

URL: http://llvm.org/viewvc/llvm-project?rev=103142&view=rev
Log:
Clean up the {} and else placement. This fixes an ambiguous else as well as
picking a more consistent pattern.

Modified:
    cfe/trunk/lib/CodeGen/CGObjC.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=103142&r1=103141&r2=103142&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Wed May  5 19:20:39 2010
@@ -419,8 +419,7 @@
     llvm::Value *SelfAsId =
       Builder.CreateBitCast(LoadObjCSelf(), Types.ConvertType(IdTy));
     EmitReturnOfRValue(RValue::get(SelfAsId), IdTy);
-  }
-  else {
+  } else {
     // dtor
     for (size_t i = IvarInitializers.size(); i > 0; --i) {
       FieldDecl *Field = IvarInitializers[i - 1]->getMember();
@@ -436,7 +435,7 @@
       const RecordType *RT = FieldType->getAs<RecordType>();
       CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RT->getDecl());
       CXXDestructorDecl *Dtor = FieldClassDecl->getDestructor(getContext());
-      if (!Dtor->isTrivial())
+      if (!Dtor->isTrivial()) {
         if (Array) {
           const llvm::Type *BasePtr = ConvertType(FieldType);
           BasePtr = llvm::PointerType::getUnqual(BasePtr);
@@ -444,12 +443,13 @@
             Builder.CreateBitCast(LV.getAddress(), BasePtr);
           EmitCXXAggrDestructorCall(Dtor,
                                     Array, BaseAddrPtr);
-        }
-        else 
+        } else {
           EmitCXXDestructorCall(Dtor,
                                 Dtor_Complete, /*ForVirtualBase=*/false,
                                 LV.getAddress());
-    }    
+        }
+      }
+    }
   }
   FinishFunction();
 }





More information about the cfe-commits mailing list