[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Jim Laskey
jlaskey at apple.com
Fri Feb 10 17:01:43 PST 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.150 -> 1.151
---
Log message:
Reorg for integration with gcc4. Old style debug info will not be passed though
to SelIDAG.
---
Diffs of the changes: (+21 -24)
SelectionDAGISel.cpp | 45 +++++++++++++++++++++------------------------
1 files changed, 21 insertions(+), 24 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.150 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.151
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.150 Sat Feb 4 00:49:00 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Feb 10 19:01:30 2006
@@ -941,33 +941,30 @@
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;
}
More information about the llvm-commits
mailing list