Start parsing node transformation information


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23337 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
     /// 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 @@
     
     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 @@
   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 @@
   
 private:
   void ParseNodeInfo();
+  void ParseNodeTransforms(std::ostream &OS);
   void ParseAndResolvePatternFragments(std::ostream &OS);
   void ParseAndResolveInstructions();
   void EmitInstructionSelector(std::ostream &OS);