summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-09 17:41:47 +0000
committerChris Lattner <sabre@nondot.org>2011-07-09 17:41:47 +0000
commita5f58b05e82a06b5491c74d3a18c3ee1c749f77b (patch)
tree3de2a264c644e13e02ae7bf60329e62ad8f50901 /clang/lib/CodeGen/CodeGenModule.cpp
parentb1ed91f3978377294d4620c53ca81beed08b73c7 (diff)
downloadbcm5719-llvm-a5f58b05e82a06b5491c74d3a18c3ee1c749f77b.tar.gz
bcm5719-llvm-a5f58b05e82a06b5491c74d3a18c3ee1c749f77b.zip
clang side to match the LLVM IR type system rewrite patch.
llvm-svn: 134831
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ddef39726f7..95d7be5392e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -857,8 +857,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
return Entry;
// Make sure the result is of the correct type.
- const llvm::Type *PTy = llvm::PointerType::getUnqual(Ty);
- return llvm::ConstantExpr::getBitCast(Entry, PTy);
+ return llvm::ConstantExpr::getBitCast(Entry, Ty->getPointerTo());
}
// This function doesn't have a complete type (for example, the return
@@ -928,7 +927,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
return F;
}
- const llvm::Type *PTy = llvm::PointerType::getUnqual(Ty);
+ llvm::Type *PTy = llvm::PointerType::getUnqual(Ty);
return llvm::ConstantExpr::getBitCast(F, PTy);
}
@@ -1442,7 +1441,7 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) {
bool variadic = false;
if (const FunctionProtoType *fpt = D->getType()->getAs<FunctionProtoType>())
variadic = fpt->isVariadic();
- const llvm::FunctionType *Ty = getTypes().GetFunctionType(FI, variadic, false);
+ const llvm::FunctionType *Ty = getTypes().GetFunctionType(FI, variadic);
// Get or create the prototype for the function.
llvm::Constant *Entry = GetAddrOfFunction(GD, Ty);
@@ -1613,10 +1612,12 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false);
}
-llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,const llvm::Type **Tys,
+llvm::Function *CodeGenModule::getIntrinsic(unsigned IID, llvm::Type **Tys,
unsigned NumTys) {
return llvm::Intrinsic::getDeclaration(&getModule(),
- (llvm::Intrinsic::ID)IID, Tys, NumTys);
+ (llvm::Intrinsic::ID)IID,
+ const_cast<const llvm::Type **>(Tys),
+ NumTys);
}
static llvm::StringMapEntry<llvm::Constant*> &
OpenPOWER on IntegriCloud