diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-14 04:03:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-14 04:03:16 +0000 |
commit | ec67643e8682402cfd1535ff88f5ce7af0812be0 (patch) | |
tree | 365c5f017d71615a28c1bc2435dea0e98fbcdaf3 /utils/TableGen/DAGISelEmitter.h | |
parent | 5f8cb2a28a75acb85d8e96c6f5af157506ae08d6 (diff) | |
download | external_llvm-ec67643e8682402cfd1535ff88f5ce7af0812be0.zip external_llvm-ec67643e8682402cfd1535ff88f5ce7af0812be0.tar.gz external_llvm-ec67643e8682402cfd1535ff88f5ce7af0812be0.tar.bz2 |
Switch to a slightly more structured representation for instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.h')
-rw-r--r-- | utils/TableGen/DAGISelEmitter.h | 21 |
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 |