diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:28:45 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:28:45 +0000 |
| commit | 379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89 (patch) | |
| tree | 76f2336957b62005e10d223d5493eda780e27cef /llvm/lib/VMCore/Module.cpp | |
| parent | f0e92b575f675ee8fb09b7fdb56cc27e8a5bdd21 (diff) | |
| download | bcm5719-llvm-379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89.tar.gz bcm5719-llvm-379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89.zip | |
Add new linkage types to support a real frontend
llvm-svn: 5786
Diffstat (limited to 'llvm/lib/VMCore/Module.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Module.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp index f54a6f390be..e0a6fb271ce 100644 --- a/llvm/lib/VMCore/Module.cpp +++ b/llvm/lib/VMCore/Module.cpp @@ -17,13 +17,14 @@ Function *ilist_traits<Function>::createNode() { FunctionType *FTy = FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false); - Function *Ret = new Function(FTy, false); + Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; } GlobalVariable *ilist_traits<GlobalVariable>::createNode() { - GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false, false); + GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false, + GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; @@ -87,7 +88,7 @@ Function *Module::getOrInsertFunction(const std::string &Name, if (Value *V = SymTab.lookup(PointerType::get(Ty), Name)) { return cast<Function>(V); // Yup, got it } else { // Nope, add one - Function *New = new Function(Ty, false, Name); + Function *New = new Function(Ty, GlobalVariable::ExternalLinkage, Name); FunctionList.push_back(New); return New; // Return the new prototype... } |

