diff options
author | Anders Carlsson <andersca@mac.com> | 2009-04-15 04:10:19 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-04-15 04:10:19 +0000 |
commit | c483bd07242f7cdf82ab62367052709df18c389c (patch) | |
tree | c4db8278c85e9f9fcd94f90b9882dbfe84849a1c /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 55b6908f002805c9bfd65b303420134689f5afbf (diff) | |
download | bcm5719-llvm-c483bd07242f7cdf82ab62367052709df18c389c.tar.gz bcm5719-llvm-c483bd07242f7cdf82ab62367052709df18c389c.zip |
Simplify CodeGenFunction::GenerateCode.
llvm-svn: 69134
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 7ddc2213705..4bdebfe4315 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -225,16 +225,11 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD, 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) |