diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-30 20:59:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-30 20:59:49 +0000 |
commit | 7f460203b0c5350e9b2c592f438e40f7a7de6e45 (patch) | |
tree | c359664a644283e7bd556af296487536fa21eaf4 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | db8d56b825efeb576d67b9dbe39d736d93306222 (diff) |
Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect its
purpose, and give it a custom SDNode subclass so that it doesn't
need to have line number, column number, filename string, and
directory string, all existing as individual SDNodes to be the
operands.
This was the only user of ISD::STRING, StringSDNode, etc., so
remove those and some associated code.
This makes stop-points considerably easier to read in
-view-legalize-dags output, and reduces overhead (creating new
nodes and copying std::strings into them) on code containing
debugging information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6456fa30e3..c364e1f737 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -382,6 +382,13 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) { case ISD::Register: ID.AddInteger(cast<RegisterSDNode>(N)->getReg()); break; + case ISD::DBG_STOPPOINT: { + const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(N); + ID.AddInteger(DSP->getLine()); + ID.AddInteger(DSP->getColumn()); + ID.AddPointer(DSP->getCompileUnit()); + break; + } case ISD::SRCVALUE: ID.AddPointer(cast<SrcValueSDNode>(N)->getValue()); break; @@ -575,9 +582,6 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) { bool Erased = false; switch (N->getOpcode()) { case ISD::HANDLENODE: return; // noop. - case ISD::STRING: - Erased = StringNodes.erase(cast<StringSDNode>(N)->getValue()); - break; case ISD::CONDCODE: assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] && "Cond code doesn't exist!"); @@ -738,15 +742,6 @@ SDOperand SelectionDAG::getZeroExtendInReg(SDOperand Op, MVT VT) { getConstant(Imm, Op.getValueType())); } -SDOperand SelectionDAG::getString(const std::string &Val) { - StringSDNode *&N = StringNodes[Val]; - if (!N) { - N = new StringSDNode(Val); - AllNodes.push_back(N); - } - return SDOperand(N, 0); -} - SDOperand SelectionDAG::getConstant(uint64_t Val, MVT VT, bool isT) { MVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT; return getConstant(APInt(EltVT.getSizeInBits(), Val), VT, isT); @@ -1005,6 +1000,24 @@ SDOperand SelectionDAG::getRegister(unsigned RegNo, MVT VT) { return SDOperand(N, 0); } +SDOperand SelectionDAG::getDbgStopPoint(SDOperand Root, + unsigned Line, unsigned Col, + const CompileUnitDesc *CU) { + FoldingSetNodeID ID; + SDOperand Ops[] = { Root }; + AddNodeIDNode(ID, ISD::DBG_STOPPOINT, getVTList(MVT::Other), &Ops[0], 1); + ID.AddInteger(Line); + ID.AddInteger(Col); + ID.AddPointer(CU); + void *IP = 0; + if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) + return SDOperand(E, 0); + SDNode *N = new DbgStopPointSDNode(Root, Line, Col, CU); + CSEMap.InsertNode(N, IP); + AllNodes.push_back(N); + return SDOperand(N, 0); +} + SDOperand SelectionDAG::getSrcValue(const Value *V) { assert((!V || isa<PointerType>(V->getType())) && "SrcValue is not a pointer?"); @@ -4178,7 +4191,6 @@ void UnarySDNode::ANCHOR() {} void BinarySDNode::ANCHOR() {} void TernarySDNode::ANCHOR() {} void HandleSDNode::ANCHOR() {} -void StringSDNode::ANCHOR() {} void ConstantSDNode::ANCHOR() {} void ConstantFPSDNode::ANCHOR() {} void GlobalAddressSDNode::ANCHOR() {} @@ -4189,6 +4201,7 @@ void BasicBlockSDNode::ANCHOR() {} void SrcValueSDNode::ANCHOR() {} void MemOperandSDNode::ANCHOR() {} void RegisterSDNode::ANCHOR() {} +void DbgStopPointSDNode::ANCHOR() {} void ExternalSymbolSDNode::ANCHOR() {} void CondCodeSDNode::ANCHOR() {} void ARG_FLAGSSDNode::ANCHOR() {} @@ -4463,7 +4476,6 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::AssertSext: return "AssertSext"; case ISD::AssertZext: return "AssertZext"; - case ISD::STRING: return "String"; case ISD::BasicBlock: return "BasicBlock"; case ISD::ARG_FLAGS: return "ArgFlags"; case ISD::VALUETYPE: return "ValueType"; @@ -4624,7 +4636,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::CTLZ: return "ctlz"; // Debug info - case ISD::LOCATION: return "location"; + case ISD::DBG_STOPPOINT: return "dbg_stoppoint"; case ISD::DEBUG_LOC: return "debug_loc"; // Trampolines |