[cfe-commits] r69134 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Anders Carlsson andersca at mac.com
Tue Apr 14 21:10:21 PDT 2009


Author: andersca
Date: Tue Apr 14 23:10:19 2009
New Revision: 69134

URL: http://llvm.org/viewvc/llvm-project?rev=69134&view=rev
Log:
Simplify CodeGenFunction::GenerateCode.

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

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Tue Apr 14 23:10:19 2009
@@ -225,16 +225,11 @@
                                     FProto->getArgType(i)));
   }
 
-  StartFunction(FD, FD->getResultType(), Fn, Args,
-                cast<CompoundStmt>(FD->getBody())->getLBracLoc());
+  const CompoundStmt *S = FD->getBody();
 
-  EmitStmt(FD->getBody());
-  
-  const CompoundStmt *S = dyn_cast<CompoundStmt>(FD->getBody());
-  if (S)
-    FinishFunction(S->getRBracLoc());
-  else
-    FinishFunction();
+  StartFunction(FD, FD->getResultType(), Fn, Args, S->getLBracLoc());
+  EmitStmt(S);
+  FinishFunction(S->getRBracLoc());
     
   // Destroy the 'this' declaration.
   if (CXXThisDecl)





More information about the cfe-commits mailing list