improve comments on OPC_Record to say what we're recording a node.
[oota-llvm.git] / utils / TableGen / DAGISelMatcher.h
index 68737e2796b436323442c85401d97b42615f728d..e20a00ee313e258d9f166b0ae50ac194fe45453d 100644 (file)
@@ -127,8 +127,14 @@ public:
 
 /// RecordMatcherNode - Save the current node in the operand list.
 class RecordMatcherNode : public MatcherNodeWithChild {
+  /// WhatFor - This is a string indicating why we're recording this.  This
+  /// should only be used for comment generation not anything semantic.
+  std::string WhatFor;
 public:
-  RecordMatcherNode() : MatcherNodeWithChild(Record) {}
+  RecordMatcherNode(StringRef whatfor)
+    : MatcherNodeWithChild(Record), WhatFor(whatfor) {}
+  
+  StringRef getWhatFor() const { return WhatFor; }
   
   static inline bool classof(const MatcherNode *N) {
     return N->getKind() == Record;
@@ -317,6 +323,8 @@ public:
   CheckComplexPatMatcherNode(const ComplexPattern &pattern)
   : MatcherNodeWithChild(CheckComplexPat), Pattern(pattern) {}
   
+  const ComplexPattern &getPattern() const { return Pattern; }
+  
   static inline bool classof(const MatcherNode *N) {
     return N->getKind() == CheckComplexPat;
   }