diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-05-06 00:20:39 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-05-06 00:20:39 +0000 |
commit | bc397cf90355f17c974b0bdf3960e8fb38caf5d6 (patch) | |
tree | 332f420cd90133c120eb4f00ae6cc9cf2b17718c /lib/CodeGen/CGObjC.cpp | |
parent | 0ee93de27c2546fae9a1c7262ebe7eef85c89b66 (diff) |
Clean up the {} and else placement. This fixes an ambiguous else as well as
picking a more consistent pattern.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index cd369c6f11..7ea075d213 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -419,8 +419,7 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, 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 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, 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 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, Builder.CreateBitCast(LV.getAddress(), BasePtr); EmitCXXAggrDestructorCall(Dtor, Array, BaseAddrPtr); - } - else + } else { EmitCXXDestructorCall(Dtor, Dtor_Complete, /*ForVirtualBase=*/false, LV.getAddress()); - } + } + } + } } FinishFunction(); } |