mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
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:
@@ -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...
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user