summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 00:13:42 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 00:13:42 +0000
commit11074fa73e8b0f925763266661e3af6fe62defed (patch)
treebe274e4e731ed77adc34c14400af7729bee46547 /llvm/lib
parentcc55b9086d812722807b152a214d4f85065961e7 (diff)
downloadbcm5719-llvm-11074fa73e8b0f925763266661e3af6fe62defed.tar.gz
bcm5719-llvm-11074fa73e8b0f925763266661e3af6fe62defed.zip
Handle external symbols
llvm-svn: 84711
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.cpp15
-rw-r--r--llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.cpp b/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.cpp
index 8c6e2fe90ac..f505b239b63 100644
--- a/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.cpp
+++ b/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.cpp
@@ -41,6 +41,19 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
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::
GetJumpTableSymbol(const MachineOperand &MO) const {
@@ -118,11 +131,9 @@ void MSP430MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
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;
diff --git a/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.h b/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.h
index 606424641cd..a2b99ae83c0 100644
--- a/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.h
+++ b/llvm/lib/Target/MSP430/AsmPrinter/MSP430MCInstLower.h
@@ -39,6 +39,7 @@ public:
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
+ MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
};
OpenPOWER on IntegriCloud