aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-13 02:16:35 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-13 02:16:35 +0000
commitb094016854943591284b7230d466cecc9bcce9ef (patch)
tree3fe4d37e609073b439fec8149bc69306177c8f95 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent2ca91b1efb155855e8a02b7db90301c90394128b (diff)
downloadexternal_llvm-b094016854943591284b7230d466cecc9bcce9ef.zip
external_llvm-b094016854943591284b7230d466cecc9bcce9ef.tar.gz
external_llvm-b094016854943591284b7230d466cecc9bcce9ef.tar.bz2
Revert this. It was breaking stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 8cba55f..e5a30c8 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1274,9 +1274,38 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
switch (TLI.getOperationAction(ISD::DBG_STOPPOINT, MVT::Other)) {
case TargetLowering::Promote:
default: assert(0 && "This action is not supported yet!");
- case TargetLowering::Expand:
- Result = Tmp1; // chain
+ case TargetLowering::Expand: {
+ DwarfWriter *DW = DAG.getDwarfWriter();
+ bool useDEBUG_LOC = TLI.isOperationLegalOrCustom(ISD::DEBUG_LOC,
+ MVT::Other);
+ bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL, MVT::Other);
+
+ const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(Node);
+ GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit());
+ if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) {
+ DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit()));
+ unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
+ CU.getFilename());
+
+ unsigned Line = DSP->getLine();
+ unsigned Col = DSP->getColumn();
+
+ // A bit self-referential to have DebugLoc on Debug_Loc nodes, but
+ // it won't hurt anything.
+ if (useDEBUG_LOC) {
+ SDValue Ops[] = { Tmp1, DAG.getConstant(Line, MVT::i32),
+ DAG.getConstant(Col, MVT::i32),
+ DAG.getConstant(SrcFile, MVT::i32) };
+ Result = DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Ops, 4);
+ } else {
+ unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile);
+ Result = DAG.getLabel(ISD::DBG_LABEL, dl, Tmp1, ID);
+ }
+ } else {
+ Result = Tmp1; // chain
+ }
break;
+ }
case TargetLowering::Legal: {
LegalizeAction Action = getTypeAction(Node->getOperand(1).getValueType());
if (Action == Legal && Tmp1 == Node->getOperand(0))