aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-01-04 22:28:25 +0000
committerJim Laskey <jlaskey@mac.com>2006-01-04 22:28:25 +0000
commitb2efb853f00d45b1c8d57f92acd0028fbdeffda6 (patch)
treeb5563153d7d0593950bc90ea1253acb1d787c556 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent62281a132f11e742a96ff9caeaaaa17900020acd (diff)
Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing." Fixes crash when compiling -g files and suppresses dwarf statements if no debug info is present. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index bd8c50a53d..dec782a070 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -618,8 +618,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case TargetLowering::Promote:
default: assert(0 && "This action is not supported yet!");
case TargetLowering::Expand: {
- if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other)) {
- MachineDebugInfo &DebugInfo = getMachineDebugInfo();
+ MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other) && DebugInfo) {
std::vector<SDOperand> Ops;
Ops.push_back(Tmp1); // chain
Ops.push_back(Node->getOperand(1)); // line #
@@ -628,9 +628,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
cast<StringSDNode>(Node->getOperand(3))->getValue();
const std::string &dirname =
cast<StringSDNode>(Node->getOperand(4))->getValue();
- unsigned srcfile = DebugInfo.RecordSource(fname, dirname);
+ unsigned srcfile = DebugInfo->getUniqueSourceID(fname, dirname);
Ops.push_back(DAG.getConstant(srcfile, MVT::i32)); // source file id
- unsigned id = DebugInfo.NextUniqueID();
+ unsigned id = DebugInfo->getNextUniqueID();
Ops.push_back(DAG.getConstant(id, MVT::i32)); // label id
Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
} else {