diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:14:46 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:14:46 +0000 |
| commit | ba0e81d4b266ae8c7d4dd70143b53c0e108c6883 (patch) | |
| tree | c110f23c27e4a70d9dfab2baa0c7889797b8f3ce /llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | |
| parent | de60d1caefea7f2ac4e9ecc8c32350e732ae6bc1 (diff) | |
| download | bcm5719-llvm-ba0e81d4b266ae8c7d4dd70143b53c0e108c6883.tar.gz bcm5719-llvm-ba0e81d4b266ae8c7d4dd70143b53c0e108c6883.zip | |
Properly handle ExternalSymbol's
llvm-svn: 70752
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp index 64dffa9e93f..9777e772e4e 100644 --- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp +++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -71,6 +71,7 @@ MSP430TargetLowering::MSP430TargetLowering(MSP430TargetMachine &tm) : setOperationAction(ISD::SHL, MVT::i16, Custom); setOperationAction(ISD::RET, MVT::Other, Custom); setOperationAction(ISD::GlobalAddress, MVT::i16, Custom); + setOperationAction(ISD::ExternalSymbol, MVT::i16, Custom); setOperationAction(ISD::BR_CC, MVT::Other, Expand); setOperationAction(ISD::BRCOND, MVT::Other, Custom); setOperationAction(ISD::SETCC, MVT::i8, Custom); @@ -95,6 +96,7 @@ SDValue MSP430TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) { case ISD::RET: return LowerRET(Op, DAG); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); + case ISD::ExternalSymbol: return LowerExternalSymbol(Op, DAG); case ISD::SETCC: return LowerSETCC(Op, DAG); case ISD::BRCOND: return LowerBRCOND(Op, DAG); case ISD::SELECT: return LowerSELECT(Op, DAG); @@ -459,6 +461,16 @@ SDValue MSP430TargetLowering::LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) getPointerTy(), Result); } +SDValue MSP430TargetLowering::LowerExternalSymbol(SDValue Op, + SelectionDAG &DAG) { + DebugLoc dl = Op.getDebugLoc(); + const char *Sym = cast<ExternalSymbolSDNode>(Op)->getSymbol(); + SDValue Result = DAG.getTargetExternalSymbol(Sym, getPointerTy()); + + return DAG.getNode(MSP430ISD::Wrapper, dl, getPointerTy(), Result);; +} + + MVT MSP430TargetLowering::getSetCCResultType(MVT VT) const { return MVT::i8; } |

