Mercurial > projects > ldc
diff gen/tollvm.cpp @ 141:8f43f5c43c95 trunk
[svn r145] fixed some x86 problems
author | lindquist |
---|---|
date | Wed, 23 Jan 2008 12:58:51 +0100 |
parents | ce7b81fb957f |
children | a123dca8349b |
line wrap: on
line diff
--- a/gen/tollvm.cpp Wed Jan 23 12:56:09 2008 +0100 +++ b/gen/tollvm.cpp Wed Jan 23 12:58:51 2008 +0100 @@ -226,7 +226,7 @@ pvec.push_back(bits==32?int32ty:int64ty); pvec.push_back(int32ty); llvm::FunctionType* functype = llvm::FunctionType::get(voidty, pvec, false); - return new llvm::Function(functype, llvm::GlobalValue::ExternalLinkage, name, gIR->module); + return llvm::cast<llvm::Function>(gIR->module->getOrInsertFunction(name, functype)); } //////////////////////////////////////////////////////////////////////////////////////////