llvm.org GIT mirror llvm / 292df8e
add support for external symbols. The mc instprinter can now handle reasonable code like Codegen/ARM/2009-02-27-SpillerBug.ll, producing identical output except for superior formatting of constant pool entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84582 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
2 changed file(s) with 17 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
5252
5353 return Ctx.GetOrCreateSymbol(Name.str());
5454 }
55
56 MCSymbol *ARMMCInstLower::
57 GetExternalSymbolSymbol(const MachineOperand &MO) const {
58 SmallString<128> Name;
59 Name += Printer.MAI->getGlobalPrefix();
60 Name += MO.getSymbolName();
61
62 // FIXME: HANDLE PLT references how??
63 switch (MO.getTargetFlags()) {
64 default: assert(0 && "Unknown target flag on GV operand");
65 case 0: break;
66 }
67
68 return Ctx.GetOrCreateSymbol(Name.str());
69 }
70
5571
5672
5773 MCSymbol *ARMMCInstLower::
132148 case MachineOperand::MO_GlobalAddress:
133149 MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
134150 break;
135 #if 0
136151 case MachineOperand::MO_ExternalSymbol:
137152 MCOp = LowerSymbolOperand(MO, GetExternalSymbolSymbol(MO));
138153 break;
139 #endif
140154 case MachineOperand::MO_JumpTableIndex:
141155 MCOp = LowerSymbolOperand(MO, GetJumpTableSymbol(MO));
142156 break;
3939
4040 //MCSymbol *GetPICBaseSymbol() const;
4141 MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
42 //MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
42 MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
4343 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
4444 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
4545 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;