/// should only be used for comment generation not anything semantic.
std::string WhatFor;
public:
- RecordMatcherNode(StringRef whatfor)
+ RecordMatcherNode(const std::string &whatfor)
: MatcherNodeWithChild(Record), WhatFor(whatfor) {}
- StringRef getWhatFor() const { return WhatFor; }
+ const std::string &getWhatFor() const { return WhatFor; }
static inline bool classof(const MatcherNode *N) {
return N->getKind() == Record;
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) {
// Get the code suitable for matching this child. Move to the child, check
// it then move back to the parent.
- AddMatcherNode(new MoveChildMatcherNode(i));
+ AddMatcherNode(new MoveChildMatcherNode(OpNo));
EmitMatchCode(N->getChild(i), NodeNoTypes->getChild(i));
AddMatcherNode(new MoveParentMatcherNode());
}
InferPossibleTypes();
}
-
// If this node has a name associated with it, capture it in VariableMap. If
// we already saw this in the pattern, emit code to verify dagness.
if (!N->getName().empty()) {
NumRecorded += 2; // Input and output chains.
} else {
// If it is a normal named node, we must emit a 'Record' opcode.
- AddMatcherNode(new RecordMatcherNode(N->getName()));
+ AddMatcherNode(new RecordMatcherNode("$" + N->getName()));
NumRecorded = 1;
}
NextRecordedOperandNo += NumRecorded;