From 86cb643801be1308ba1da7db774b64852a119e94 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 13 Dec 2005 17:40:33 +0000 Subject: [PATCH] Don't lump the filename and working dir together git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24697 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2807abef7c9..20335fbaa47 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -895,23 +895,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { getValue(I.getOperand(2)))); return 0; - case Intrinsic::dbg_stoppoint: - { + case Intrinsic::dbg_stoppoint: { if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions()) return "llvm_debugger_stop"; std::string fname = ""; std::vector Ops; - // Pull the filename out of the the compilation unit. - const GlobalVariable *cunit = dyn_cast(I.getOperand(4)); - if (cunit && cunit->hasInitializer()) { - ConstantStruct *CS = dyn_cast(cunit->getInitializer()); - if (CS->getNumOperands() > 0) { - std::string dirname = getStringValue(CS->getOperand(4)); - fname = dirname + "/" + getStringValue(CS->getOperand(3)); - } - } // Input Chain Ops.push_back(getRoot()); @@ -921,10 +911,21 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // column Ops.push_back(getValue(I.getOperand(3))); - // filename - Ops.push_back(DAG.getString(fname)); - Ops.push_back(DAG.getString("")); - DAG.setRoot(DAG.getNode(ISD::LOCATION, MVT::Other, Ops)); + // filename/working dir + // Pull the filename out of the the compilation unit. + const GlobalVariable *cunit = dyn_cast(I.getOperand(4)); + if (cunit && cunit->hasInitializer()) { + if (ConstantStruct *CS = + dyn_cast(cunit->getInitializer())) { + if (CS->getNumOperands() > 0) { + Ops.push_back(DAG.getString(getStringValue(CS->getOperand(4)))); + Ops.push_back(DAG.getString(getStringValue(CS->getOperand(3)))); + } + } + } + + 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; } -- 2.34.1