aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/DAGISelEmitter.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.h')
-rw-r--r--utils/TableGen/DAGISelEmitter.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/utils/TableGen/DAGISelEmitter.h b/utils/TableGen/DAGISelEmitter.h
index a2409bb..3c61224 100644
--- a/utils/TableGen/DAGISelEmitter.h
+++ b/utils/TableGen/DAGISelEmitter.h
@@ -272,7 +272,24 @@ namespace llvm {
MVT::ValueType getIntrinsicType(Record *R) const;
TreePatternNode *ParseTreePattern(DagInit *DI);
};
-
+
+
+ class DAGInstruction {
+ TreePattern *Pattern;
+ unsigned NumResults;
+ unsigned NumOperands;
+ public:
+ DAGInstruction(TreePattern *TP, unsigned results, unsigned ops)
+ : Pattern(TP), NumResults(results), NumOperands(ops) {}
+
+ ~DAGInstruction() {
+ delete Pattern;
+ }
+
+ TreePattern *getPattern() const { return Pattern; }
+ unsigned getNumResults() const { return NumResults; }
+ unsigned getNumOperands() const { return NumOperands; }
+ };
/// InstrSelectorEmitter - The top-level class which coordinates construction
@@ -285,7 +302,7 @@ class DAGISelEmitter : public TableGenBackend {
std::map<Record*, SDNodeInfo> SDNodes;
std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms;
std::map<Record*, TreePattern*> PatternFragments;
- std::vector<TreePattern*> Instructions;
+ std::vector<DAGInstruction> Instructions;
/// PatternsToMatch - All of the things we are matching on the DAG. The first
/// value is the pattern to match, the second pattern is the result to