diff options
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 679a0f7404..e153ad9fd8 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -102,10 +102,11 @@ void CodeGenFunction::GenerateFunction(const Stmt *Body) { assert(!verifyFunction(*CurFn) && "Generated function is not well formed."); } -void CodeGenFunction::GenerateCode(const FunctionDecl *FD) { +void CodeGenFunction::GenerateCode(const FunctionDecl *FD, + llvm::Function *Fn) { CurFuncDecl = FD; FnRetTy = FD->getResultType(); - CurFn = cast<llvm::Function>(CGM.GetAddrOfFunctionDecl(FD, true)); + CurFn = Fn; assert(CurFn->isDeclaration() && "Function already has body?"); llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create("entry", CurFn); |