Don't use a void return type with a function that returns a value.

llvm-svn: 75364
This commit is contained in:
Dan Gohman 2009-07-11 13:56:14 +00:00
parent ccb29cd290
commit a32ee1d3f2
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ namespace {
Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) {
std::vector<const Type*> params;
const FunctionType *FTy = FunctionType::get(Type::VoidTy, params, false);
const FunctionType *FTy = FunctionType::get(G->getType()->getElementType(),
params, false);
Function *F = Function::Create(FTy, GlobalValue::ExternalLinkage, Name, M);
BasicBlock *Entry = BasicBlock::Create("entry", F);
IRBuilder<> builder(Entry);