[llvm-commits] [llvm] r84582 - in /llvm/trunk/lib/Target/ARM/AsmPrinter: ARMMCInstLower.cpp ARMMCInstLower.h
Chris Lattner
sabre at nondot.org
Mon Oct 19 17:56:16 PDT 2009
Author: lattner
Date: Mon Oct 19 19:56:16 2009
New Revision: 84582
URL: http://llvm.org/viewvc/llvm-project?rev=84582&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp?rev=84582&r1=84581&r2=84582&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp Mon Oct 19 19:56:16 2009
@@ -54,6 +54,22 @@
return Ctx.GetOrCreateSymbol(Name.str());
}
+MCSymbol *ARMMCInstLower::
+GetExternalSymbolSymbol(const MachineOperand &MO) const {
+ SmallString<128> Name;
+ Name += Printer.MAI->getGlobalPrefix();
+ Name += MO.getSymbolName();
+
+ // FIXME: HANDLE PLT references how??
+ switch (MO.getTargetFlags()) {
+ default: assert(0 && "Unknown target flag on GV operand");
+ case 0: break;
+ }
+
+ return Ctx.GetOrCreateSymbol(Name.str());
+}
+
+
MCSymbol *ARMMCInstLower::
GetJumpTableSymbol(const MachineOperand &MO) const {
@@ -133,11 +149,9 @@
case MachineOperand::MO_GlobalAddress:
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
break;
-#if 0
case MachineOperand::MO_ExternalSymbol:
MCOp = LowerSymbolOperand(MO, GetExternalSymbolSymbol(MO));
break;
-#endif
case MachineOperand::MO_JumpTableIndex:
MCOp = LowerSymbolOperand(MO, GetJumpTableSymbol(MO));
break;
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h?rev=84582&r1=84581&r2=84582&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h Mon Oct 19 19:56:16 2009
@@ -40,7 +40,7 @@
//MCSymbol *GetPICBaseSymbol() const;
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
- //MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
+ MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
More information about the llvm-commits
mailing list