summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-02-11 01:01:30 +0000
committerJim Laskey <jlaskey@mac.com>2006-02-11 01:01:30 +0000
commit5995d0160c9fca63ae8a3a308f671aee22c1bcc8 (patch)
tree06237327db4de6b6d3f41c43974ebd3c7d66fbd3 /llvm/lib/CodeGen/SelectionDAG
parentfbadd7e1eec616626a5989f1a77e6a31af61fee2 (diff)
downloadbcm5719-llvm-5995d0160c9fca63ae8a3a308f671aee22c1bcc8.tar.gz
bcm5719-llvm-5995d0160c9fca63ae8a3a308f671aee22c1bcc8.zip
Reorg for integration with gcc4. Old style debug info will not be passed though
to SelIDAG. llvm-svn: 26115
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp45
1 files changed, 21 insertions, 24 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index e2049f1cb8c..5d43f035a19 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud