mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
only use dyld stubs if not in ppc-static mode. This completes support for
non-static codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24403 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ceda605fd7
commit
9542f9714e
@ -154,20 +154,24 @@ namespace {
|
||||
void printCallOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
MVT::ValueType VT) {
|
||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||
if (MO.getType() == MachineOperand::MO_ExternalSymbol) {
|
||||
std::string Name(GlobalPrefix); Name += MO.getSymbolName();
|
||||
FnStubs.insert(Name);
|
||||
O << "L" << Name << "$stub";
|
||||
} else if (MO.getType() == MachineOperand::MO_GlobalAddress &&
|
||||
isa<Function>(MO.getGlobal()) &&
|
||||
cast<Function>(MO.getGlobal())->isExternal()) {
|
||||
// Dynamically-resolved functions need a stub for the function.
|
||||
std::string Name = Mang->getValueName(MO.getGlobal());
|
||||
FnStubs.insert(Name);
|
||||
O << "L" << Name << "$stub";
|
||||
} else {
|
||||
printOp(MI->getOperand(OpNo));
|
||||
if (!PPCGenerateStaticCode) {
|
||||
if (MO.getType() == MachineOperand::MO_ExternalSymbol) {
|
||||
std::string Name(GlobalPrefix); Name += MO.getSymbolName();
|
||||
FnStubs.insert(Name);
|
||||
O << "L" << Name << "$stub";
|
||||
return;
|
||||
} else if (MO.getType() == MachineOperand::MO_GlobalAddress &&
|
||||
isa<Function>(MO.getGlobal()) &&
|
||||
cast<Function>(MO.getGlobal())->isExternal()) {
|
||||
// Dynamically-resolved functions need a stub for the function.
|
||||
std::string Name = Mang->getValueName(MO.getGlobal());
|
||||
FnStubs.insert(Name);
|
||||
O << "L" << Name << "$stub";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
printOp(MI->getOperand(OpNo));
|
||||
}
|
||||
void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
MVT::ValueType VT) {
|
||||
@ -334,7 +338,9 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
||||
std::string Name = Mang->getValueName(GV);
|
||||
|
||||
// External or weakly linked global variables need non-lazily-resolved stubs
|
||||
if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())){
|
||||
if (!PPCGenerateStaticCode &&
|
||||
((GV->isExternal() || GV->hasWeakLinkage() ||
|
||||
GV->hasLinkOnceLinkage()))) {
|
||||
if (GV->hasLinkOnceLinkage())
|
||||
LinkOnceStubs.insert(Name);
|
||||
else
|
||||
@ -343,7 +349,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
||||
return;
|
||||
}
|
||||
|
||||
O << Mang->getValueName(GV);
|
||||
O << Name;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user