diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-02-11 01:01:30 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-02-11 01:01:30 +0000 |
commit | ce72b1755f5993a42c2e04e32a93fa5228a285d4 (patch) | |
tree | 86bf82bb32eaa325062e4c8f27b4aeababb07ed5 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | c23580969fb3ac419641608bb46f4239062c187f (diff) |
Reorg for integration with gcc4. Old style debug info will not be passed though
to SelIDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e2049f1cb8..5d43f035a1 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -941,33 +941,30 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions()) return "llvm_debugger_stop"; - std::string fname = "<unknown>"; - std::vector<SDOperand> Ops; + MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + if (DebugInfo && DebugInfo->Verify(I.getOperand(4))) { + std::vector<SDOperand> Ops; - // Input Chain - Ops.push_back(getRoot()); - - // line number - Ops.push_back(getValue(I.getOperand(2))); - - // column - Ops.push_back(getValue(I.getOperand(3))); - - // filename/working dir - // Pull the filename out of the the compilation unit. - const GlobalVariable *cunit = dyn_cast<GlobalVariable>(I.getOperand(4)); - if (cunit && cunit->hasInitializer()) { - if (ConstantStruct *CS = - dyn_cast<ConstantStruct>(cunit->getInitializer())) { - if (CS->getNumOperands() > 0) { - Ops.push_back(DAG.getString(getStringValue(CS->getOperand(3)))); - Ops.push_back(DAG.getString(getStringValue(CS->getOperand(4)))); - } - } + // Input Chain + Ops.push_back(getRoot()); + + // line number + Ops.push_back(getValue(I.getOperand(2))); + + // column + Ops.push_back(getValue(I.getOperand(3))); + + DebugInfoDesc *DD = DebugInfo->Deserialize(I.getOperand(4)); + assert(DD && "Not a debug information descriptor"); + CompileUnitDesc *CompileUnit = dyn_cast<CompileUnitDesc>(DD); + assert(CompileUnit && "Not a compile unit"); + Ops.push_back(DAG.getString(CompileUnit->getFileName())); + Ops.push_back(DAG.getString(CompileUnit->getDirectory())); + + if (Ops.size() == 5) // Found filename/workingdir. + DAG.setRoot(DAG.getNode(ISD::LOCATION, MVT::Other, Ops)); } - if (Ops.size() == 5) // Found filename/workingdir. - DAG.setRoot(DAG.getNode(ISD::LOCATION, MVT::Other, Ops)); setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType()))); return 0; } |