mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Handle external symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8ecaf237e0
commit
0a2e206b40
@ -41,6 +41,19 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
|
|||||||
return Ctx.GetOrCreateSymbol(Name.str());
|
return Ctx.GetOrCreateSymbol(Name.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MCSymbol *MSP430MCInstLower::
|
||||||
|
GetExternalSymbolSymbol(const MachineOperand &MO) const {
|
||||||
|
SmallString<128> Name;
|
||||||
|
Name += Printer.MAI->getGlobalPrefix();
|
||||||
|
Name += MO.getSymbolName();
|
||||||
|
|
||||||
|
switch (MO.getTargetFlags()) {
|
||||||
|
default: assert(0 && "Unknown target flag on GV operand");
|
||||||
|
case 0: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ctx.GetOrCreateSymbol(Name.str());
|
||||||
|
}
|
||||||
|
|
||||||
MCSymbol *MSP430MCInstLower::
|
MCSymbol *MSP430MCInstLower::
|
||||||
GetJumpTableSymbol(const MachineOperand &MO) const {
|
GetJumpTableSymbol(const MachineOperand &MO) const {
|
||||||
@ -118,11 +131,9 @@ void MSP430MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
|||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
||||||
break;
|
break;
|
||||||
#if 0
|
|
||||||
case MachineOperand::MO_ExternalSymbol:
|
case MachineOperand::MO_ExternalSymbol:
|
||||||
MCOp = LowerSymbolOperand(MO, GetExternalSymbolSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetExternalSymbolSymbol(MO));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case MachineOperand::MO_JumpTableIndex:
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
MCOp = LowerSymbolOperand(MO, GetJumpTableSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetJumpTableSymbol(MO));
|
||||||
break;
|
break;
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
||||||
|
|
||||||
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
|
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
|
||||||
|
MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
|
||||||
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
|
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
|
||||||
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
|
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user