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 /include/llvm/CodeGen/SelectionDAGNodes.h | |
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 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 7261f4e102..addf355806 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -37,6 +37,7 @@ class GlobalValue; class MachineBasicBlock; class MachineConstantPoolValue; class SDNode; +class CompileUnitDesc; template <typename T> struct DenseMapInfo; template <typename T> struct simplify_type; template <typename T> struct ilist_traits; @@ -82,7 +83,7 @@ namespace ISD { AssertSext, AssertZext, // Various leaf nodes. - STRING, BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register, + BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register, Constant, ConstantFP, GlobalAddress, GlobalTLSAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol, @@ -547,11 +548,11 @@ namespace ISD { // HANDLENODE node - Used as a handle for various purposes. HANDLENODE, - // LOCATION - This node is used to represent a source location for debug - // info. It takes token chain as input, then a line number, then a column - // number, then a filename, then a working dir. It produces a token chain - // as output. - LOCATION, + // DBG_STOPPOINT - This node is used to represent a source location for + // debug info. It takes token chain as input, and carries a line number, + // column number, and a pointer to a CompileUnitDesc object identifying + // the containing compilation unit. It produces a token chain as output. + DBG_STOPPOINT, // DEBUG_LOC - This node is used to represent source line information // embedded in the code. It takes a token chain as input, then a line @@ -1552,22 +1553,6 @@ class AtomicSDNode : public MemSDNode { } }; -class StringSDNode : public SDNode { - std::string Value; - virtual void ANCHOR(); // Out-of-line virtual method to give class a home. -protected: - friend class SelectionDAG; - explicit StringSDNode(const std::string &val) - : SDNode(ISD::STRING, getSDVTList(MVT::Other)), Value(val) { - } -public: - const std::string &getValue() const { return Value; } - static bool classof(const StringSDNode *) { return true; } - static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::STRING; - } -}; - class ConstantSDNode : public SDNode { APInt Value; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. @@ -1858,6 +1843,33 @@ public: } }; +class DbgStopPointSDNode : public SDNode { + SDUse Chain; + unsigned Line; + unsigned Column; + const CompileUnitDesc *CU; + virtual void ANCHOR(); // Out-of-line virtual method to give class a home. +protected: + friend class SelectionDAG; + DbgStopPointSDNode(SDOperand ch, unsigned l, unsigned c, + const CompileUnitDesc *cu) + : SDNode(ISD::DBG_STOPPOINT, getSDVTList(MVT::Other)), + Line(l), Column(c), CU(cu) { + Chain = ch; + InitOperands(&Chain, 1); + } +public: + + unsigned getLine() const { return Line; } + unsigned getColumn() const { return Column; } + const CompileUnitDesc *getCompileUnit() const { return CU; } + + static bool classof(const DbgStopPointSDNode *) { return true; } + static bool classof(const SDNode *N) { + return N->getOpcode() == ISD::DBG_STOPPOINT; + } +}; + class ExternalSymbolSDNode : public SDNode { const char *Symbol; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. |