summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-04-15 04:10:19 +0000
committerAnders Carlsson <andersca@mac.com>2009-04-15 04:10:19 +0000
commitc483bd07242f7cdf82ab62367052709df18c389c (patch)
treec4db8278c85e9f9fcd94f90b9882dbfe84849a1c /clang/lib/CodeGen/CodeGenFunction.cpp
parent55b6908f002805c9bfd65b303420134689f5afbf (diff)
downloadbcm5719-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.cpp13
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)
OpenPOWER on IntegriCloud