aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/DAGISelEmitter.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-13 21:51:00 +0000
committerChris Lattner <sabre@nondot.org>2005-09-13 21:51:00 +0000
commit24eeeb8c3e80e22cb2fd311580ae22b5e3ae7b51 (patch)
tree5244cc8cf6342deee48e5d4fed4d1b69e69f4e41 /utils/TableGen/DAGISelEmitter.h
parent8f493130bb51dea34c49e08aeab161e6a32dfdc6 (diff)
downloadexternal_llvm-24eeeb8c3e80e22cb2fd311580ae22b5e3ae7b51.zip
external_llvm-24eeeb8c3e80e22cb2fd311580ae22b5e3ae7b51.tar.gz
external_llvm-24eeeb8c3e80e22cb2fd311580ae22b5e3ae7b51.tar.bz2
Start parsing node transformation information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.h')
-rw-r--r--utils/TableGen/DAGISelEmitter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelEmitter.h b/utils/TableGen/DAGISelEmitter.h
index 6e39a5f..d160522 100644
--- a/utils/TableGen/DAGISelEmitter.h
+++ b/utils/TableGen/DAGISelEmitter.h
@@ -120,6 +120,10 @@ namespace llvm {
/// for a match. If this string is empty, no predicate is involved.
std::string PredicateFn;
+ /// TransformFn - The transformation function to execute on this node before
+ /// it can be substituted into the resulting instruction on a pattern match.
+ std::string TransformFn;
+
std::vector<TreePatternNode*> Children;
public:
TreePatternNode(Record *Op, const std::vector<TreePatternNode*> &Ch)
@@ -147,6 +151,9 @@ namespace llvm {
const std::string &getPredicateFn() const { return PredicateFn; }
void setPredicateFn(const std::string &Fn) { PredicateFn = Fn; }
+
+ const std::string &getTransformFn() const { return TransformFn; }
+ void setTransformFn(const std::string &Fn) { TransformFn = Fn; }
void print(std::ostream &OS) const;
void dump() const;
@@ -276,6 +283,7 @@ class DAGISelEmitter : public TableGenBackend {
CodeGenTarget Target;
std::map<Record*, SDNodeInfo> SDNodes;
+ std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms;
std::map<Record*, TreePattern*> PatternFragments;
std::vector<TreePattern*> Instructions;
public:
@@ -296,6 +304,7 @@ public:
private:
void ParseNodeInfo();
+ void ParseNodeTransforms(std::ostream &OS);
void ParseAndResolvePatternFragments(std::ostream &OS);
void ParseAndResolveInstructions();
void EmitInstructionSelector(std::ostream &OS);