mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
improve comments on OPC_Record to say what we're recording a node.
llvm-svn: 96433
This commit is contained in:
parent
2a4208c74e
commit
ab430d225c
@ -127,8 +127,14 @@ public:
|
|||||||
|
|
||||||
/// RecordMatcherNode - Save the current node in the operand list.
|
/// RecordMatcherNode - Save the current node in the operand list.
|
||||||
class RecordMatcherNode : public MatcherNodeWithChild {
|
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:
|
public:
|
||||||
RecordMatcherNode() : MatcherNodeWithChild(Record) {}
|
RecordMatcherNode(StringRef whatfor)
|
||||||
|
: MatcherNodeWithChild(Record), WhatFor(whatfor) {}
|
||||||
|
|
||||||
|
StringRef getWhatFor() const { return WhatFor; }
|
||||||
|
|
||||||
static inline bool classof(const MatcherNode *N) {
|
static inline bool classof(const MatcherNode *N) {
|
||||||
return N->getKind() == Record;
|
return N->getKind() == Record;
|
||||||
|
@ -126,7 +126,9 @@ EmitMatcher(const MatcherNode *N, unsigned Indent) {
|
|||||||
OS.PadToColumn(Indent*2) << "OPC_Emit, /*XXX*/\n\n";
|
OS.PadToColumn(Indent*2) << "OPC_Emit, /*XXX*/\n\n";
|
||||||
return 1;
|
return 1;
|
||||||
case MatcherNode::Record:
|
case MatcherNode::Record:
|
||||||
OS << "OPC_Record,\n";
|
OS << "OPC_Record,";
|
||||||
|
OS.PadToColumn(CommentIndent) << "// "
|
||||||
|
<< cast<RecordMatcherNode>(N)->getWhatFor() << '\n';
|
||||||
return 1;
|
return 1;
|
||||||
case MatcherNode::MoveChild:
|
case MatcherNode::MoveChild:
|
||||||
OS << "OPC_MoveChild, "
|
OS << "OPC_MoveChild, "
|
||||||
|
@ -288,7 +288,7 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N,
|
|||||||
NumRecorded += 2; // Input and output chains.
|
NumRecorded += 2; // Input and output chains.
|
||||||
} else {
|
} else {
|
||||||
// If it is a normal named node, we must emit a 'Record' opcode.
|
// If it is a normal named node, we must emit a 'Record' opcode.
|
||||||
AddMatcherNode(new RecordMatcherNode());
|
AddMatcherNode(new RecordMatcherNode(N->getName()));
|
||||||
NumRecorded = 1;
|
NumRecorded = 1;
|
||||||
}
|
}
|
||||||
NextRecordedOperandNo += NumRecorded;
|
NextRecordedOperandNo += NumRecorded;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user