improve comments on OPC_Record to say what we're recording a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h
index b5dabaf..e20a00e 100644
--- a/utils/TableGen/DAGISelMatcher.h
+++ b/utils/TableGen/DAGISelMatcher.h
@@ -127,8 +127,14 @@
/// 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;