Add new linkage types to support a real frontend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-04-16 20:28:45 +00:00
parent 2c72b184b8
commit 4ad02e726d
26 changed files with 334 additions and 224 deletions
+4 -3
View File
@@ -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...
}