aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp8
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
2 files changed, 6 insertions, 5 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 {
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 103a00a25c..b7dd97c62a 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -21,6 +21,7 @@
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
+#include "llvm/CodeGen/MachineDebugInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -1640,7 +1641,7 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
FunctionLoweringInfo &FuncInfo) {
- SelectionDAG DAG(TLI, MF);
+ SelectionDAG DAG(TLI, MF, getAnalysisToUpdate<MachineDebugInfo>());
CurDAG = &DAG;
std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;