[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 28 22:15:51 PST 2005
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.70 -> 1.71
SelectionDAGNodes.h updated: 1.78 -> 1.79
---
Log message:
Add support for a new STRING and LOCATION node for line number support, patch
contributed by Daniel Berlin, with a few cleanups here and there by me.
---
Diffs of the changes: (+24 -1)
SelectionDAG.h | 2 ++
SelectionDAGNodes.h | 23 ++++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 llvm/include/llvm/CodeGen/SelectionDAG.h:1.71
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 Fri Nov 18 19:42:10 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Nov 29 00:15:39 2005
@@ -105,6 +105,7 @@
/// argument, it is used as the seed for node deletion.
void RemoveDeadNodes(SDNode *N = 0);
+ SDOperand getString(const std::string &Val);
SDOperand getConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getConstantFP(double Val, MVT::ValueType VT);
@@ -406,6 +407,7 @@
std::vector<SDNode*> ValueTypeNodes;
std::map<std::string, SDNode*> ExternalSymbols;
std::map<std::string, SDNode*> TargetExternalSymbols;
+ std::map<std::string, StringSDNode*> StringNodes;
std::map<std::pair<unsigned,
std::pair<MVT::ValueType, std::vector<SDOperand> > >,
SDNode*> OneResultNodes;
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 Tue Nov 22 12:15:59 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Nov 29 00:15:39 2005
@@ -63,7 +63,8 @@
AssertSext, AssertZext,
// Various leaf nodes.
- Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool,
+ Constant, ConstantFP, STRING,
+ GlobalAddress, FrameIndex, ConstantPool,
BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, Register,
// TargetConstant - Like Constant, but the DAG does not do any folding or
@@ -341,6 +342,12 @@
// 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,
+
// BUILTIN_OP_END - This must be the last enum value in this list.
BUILTIN_OP_END,
};
@@ -846,6 +853,20 @@
SDOperand getValue() const { return getOperand(0); }
};
+class StringSDNode : public SDNode {
+ std::string Value;
+protected:
+ friend class SelectionDAG;
+ StringSDNode(const std::string &val)
+ : SDNode(ISD::STRING, 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 {
uint64_t Value;
More information about the llvm-commits
mailing list