some cleanups on top of David's patch.  There are still two
remaining open issues I've communicated to him:

1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
   all parent class ivars) and flattens classes.  If A derives from B, 
   and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.

David, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48970 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 3e811a7..5f47bb7 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -26,7 +26,7 @@
 
 CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) 
   : CGM(cgm), Target(CGM.getContext().Target), SwitchInsn(NULL), 
-    CaseRangeBlock(NULL)  {}
+    CaseRangeBlock(NULL) {}
 
 ASTContext &CodeGenFunction::getContext() const {
   return CGM.getContext();
@@ -64,11 +64,11 @@
   for (unsigned i=0 ; i<OMD->param_size() ; i++) {
     ParamTypes.push_back(ConvertType(OMD->getParamDecl(i)->getType()));
   }
-  CurFn = CGM.getObjCRuntime()->MethodPreamble(ConvertType(OMD->getResultType()),
-      llvm::PointerType::getUnqual(llvm::Type::Int32Ty),
-      ParamTypes.begin(),
-      OMD->param_size(),
-      OMD->isVariadic());
+  CurFn =CGM.getObjCRuntime()->MethodPreamble(ConvertType(OMD->getResultType()),
+                      llvm::PointerType::getUnqual(llvm::Type::Int32Ty),
+                                              ParamTypes.begin(),
+                                              OMD->param_size(),
+                                              OMD->isVariadic());
   llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);
   
   // Create a marker to make it easy to insert allocas into the entryblock