aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/XCore/XCoreISelLowering.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-02-07 00:55:49 +0000
committerDale Johannesen <dalej@apple.com>2009-02-07 00:55:49 +0000
commitb300d2aa3ef08b5074449e2c05804717f488f4e4 (patch)
treece1748ecd2653385baa4f772f32234f7698886b2 /lib/Target/XCore/XCoreISelLowering.cpp
parent2d0a1cc4161b4616b725d9f28c4492f5e4de5260 (diff)
downloadexternal_llvm-b300d2aa3ef08b5074449e2c05804717f488f4e4.zip
external_llvm-b300d2aa3ef08b5074449e2c05804717f488f4e4.tar.gz
external_llvm-b300d2aa3ef08b5074449e2c05804717f488f4e4.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/XCoreISelLowering.cpp')
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp14
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);
}