summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/CodeGen/CodeGenFunction.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp
index ef80e51d0e3..9da66c635bd 100644
--- a/clang/CodeGen/CodeGenFunction.cpp
+++ b/clang/CodeGen/CodeGenFunction.cpp
@@ -26,6 +26,10 @@ using namespace CodeGen;
CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
: CGM(cgm), Target(CGM.getContext().Target) {}
+ASTContext &CodeGenFunction::getContext() const {
+ return CGM.getContext();
+}
+
llvm::BasicBlock *CodeGenFunction::getBasicBlockForLabel(const LabelStmt *S) {
BasicBlock *&BB = LabelMap[S];
@@ -131,6 +135,8 @@ const llvm::Type *CodeGenFunction::ConvertType(QualType T, SourceLocation Loc) {
void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
+ LLVMIntTy = ConvertType(getContext().IntTy, FD->getLocation());
+
const llvm::FunctionType *Ty =
cast<llvm::FunctionType>(ConvertType(FD->getType(), FD->getLocation()));
OpenPOWER on IntegriCloud