diff options
author | Dale Johannesen <dalej@apple.com> | 2009-02-07 00:55:49 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-02-07 00:55:49 +0000 |
commit | 24dd9a56e50b4c931ae96a93e67c4ed85e65d989 (patch) | |
tree | ce1748ecd2653385baa4f772f32234f7698886b2 /lib/Target/XCore | |
parent | 245791b2fbfca51227f800fb0286f51ba8e50187 (diff) | |
download | external_llvm-24dd9a56e50b4c931ae96a93e67c4ed85e65d989.zip external_llvm-24dd9a56e50b4c931ae96a93e67c4ed85e65d989.tar.gz external_llvm-24dd9a56e50b4c931ae96a93e67c4ed85e65d989.tar.bz2 |
Get rid of the last non-DebugLoc versions of getNode!
Many targets build placeholder nodes for special operands, e.g.
GlobalBaseReg on X86 and PPC for the PIC base. There's no
sensible way to associate debug info with these. I've left
them built with getNode calls with explicit DebugLoc::getUnknownLoc operands.
I'm not too happy about this but don't see a good improvement;
I considered adding a getPseudoOperand or something, but it
seems to me that'll just make it harder to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore')
-rw-r--r-- | lib/Target/XCore/XCoreISelLowering.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp index 87f7199..49c8dda 100644 --- a/lib/Target/XCore/XCoreISelLowering.cpp +++ b/lib/Target/XCore/XCoreISelLowering.cpp @@ -204,8 +204,10 @@ LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) SDValue XCoreTargetLowering:: getGlobalAddressWrapper(SDValue GA, GlobalValue *GV, SelectionDAG &DAG) { + // FIXME there is no actual debug info here + DebugLoc dl = GA.getDebugLoc(); if (isa<Function>(GV)) { - return DAG.getNode(XCoreISD::PCRelativeWrapper, MVT::i32, GA); + return DAG.getNode(XCoreISD::PCRelativeWrapper, dl, MVT::i32, GA); } else if (!Subtarget.isXS1A()) { const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV); if (!GVar) { @@ -215,10 +217,10 @@ getGlobalAddressWrapper(SDValue GA, GlobalValue *GV, SelectionDAG &DAG) } bool isConst = GVar && GVar->isConstant(); if (isConst) { - return DAG.getNode(XCoreISD::CPRelativeWrapper, MVT::i32, GA); + return DAG.getNode(XCoreISD::CPRelativeWrapper, dl, MVT::i32, GA); } } - return DAG.getNode(XCoreISD::DPRelativeWrapper, MVT::i32, GA); + return DAG.getNode(XCoreISD::DPRelativeWrapper, dl, MVT::i32, GA); } SDValue XCoreTargetLowering:: @@ -232,8 +234,8 @@ LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) return getGlobalAddressWrapper(GA, GV, DAG); } -static inline SDValue BuildGetId(SelectionDAG &DAG) { - return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, MVT::i32, +static inline SDValue BuildGetId(SelectionDAG &DAG, DebugLoc dl) { + return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, MVT::i32, DAG.getConstant(Intrinsic::xcore_getid, MVT::i32)); } @@ -269,7 +271,7 @@ LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) SDValue base = getGlobalAddressWrapper(GA, GV, DAG); const TargetData *TD = TM.getTargetData(); unsigned Size = TD->getTypePaddedSize(Ty); - SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG), + SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG, dl), DAG.getConstant(Size, MVT::i32)); return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset); } |