unsigned MatcherTableEmitter::
EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
raw_ostream &OS) {
- OS.indent(Indent*2);
+ OS.indent(Indent);
switch (N->getKind()) {
case Matcher::Scope: {
} else {
if (!OmitComments) {
OS << "/*" << format_decimal(CurrentIdx, IndexWidth) << "*/";
- OS.indent(Indent*2) << "/*Scope*/ ";
+ OS.indent(Indent) << "/*Scope*/ ";
} else
- OS.indent(Indent*2);
+ OS.indent(Indent);
}
// We need to encode the child and the offset of the failure code before
// Emit a zero as a sentinel indicating end of 'Scope'.
if (!OmitComments)
OS << "/*" << format_decimal(CurrentIdx, IndexWidth) << "*/";
- OS.indent(Indent*2) << "0, ";
+ OS.indent(Indent) << "0, ";
if (!OmitComments)
OS << "/*End of Scope*/";
OS << '\n';
if (i != 0) {
if (!OmitComments)
OS << "/*" << format_decimal(CurrentIdx, IndexWidth) << "*/";
- OS.indent(Indent*2);
+ OS.indent(Indent);
if (!OmitComments)
OS << (isa<SwitchOpcodeMatcher>(N) ?
"/*SwitchOpcode*/ " : "/*SwitchType*/ ");
// Emit the final zero to terminate the switch.
if (!OmitComments)
OS << "/*" << format_decimal(CurrentIdx, IndexWidth) << "*/";
- OS.indent(Indent*2) << "0,";
+ OS.indent(Indent) << "0,";
if (!OmitComments)
OS << (isa<SwitchOpcodeMatcher>(N) ?
" // EndSwitchOpcode" : " // EndSwitchType");
unsigned Offset =
getPatternIdxFromTable(src + " -> " + dst, std::move(include_src));
OS << "TARGET_VAL(" << Offset << "),\n";
- OS.indent(FullIndexWidth + Indent * 2);
+ OS.indent(FullIndexWidth + Indent);
}
}
const EmitNodeMatcherCommon *EN = cast<EmitNodeMatcherCommon>(N);
OS << "|OPFL_Variadic" << EN->getNumFixedArityOperands();
OS << ",\n";
- OS.indent(FullIndexWidth + Indent*2+4);
+ OS.indent(FullIndexWidth + Indent+4);
if (!CompressVTs) {
OS << EN->getNumVTs();
if (!OmitComments)
OS << '\n';
if (const MorphNodeToMatcher *SNT = dyn_cast<MorphNodeToMatcher>(N)) {
- OS.indent(FullIndexWidth + Indent*2) << "// Src: "
+ OS.indent(FullIndexWidth + Indent) << "// Src: "
<< *SNT->getPattern().getSrcPattern() << " - Complexity = "
<< SNT->getPattern().getPatternComplexity(CGP) << '\n';
- OS.indent(FullIndexWidth + Indent*2) << "// Dst: "
+ OS.indent(FullIndexWidth + Indent) << "// Dst: "
<< *SNT->getPattern().getDstPattern() << '\n';
}
} else
unsigned Offset =
getPatternIdxFromTable(src + " -> " + dst, std::move(include_src));
OS << "TARGET_VAL(" << Offset << "),\n";
- OS.indent(FullIndexWidth + Indent * 2);
+ OS.indent(FullIndexWidth + Indent);
}
OS << "OPC_CompleteMatch, " << CM->getNumResults() << ", ";
unsigned NumResultBytes = 0;
NumResultBytes += EmitVBRValue(CM->getResult(i), OS);
OS << '\n';
if (!OmitComments) {
- OS.indent(FullIndexWidth + Indent*2) << " // Src: "
+ OS.indent(FullIndexWidth + Indent) << " // Src: "
<< *CM->getPattern().getSrcPattern() << " - Complexity = "
<< CM->getPattern().getPatternComplexity(CGP) << '\n';
- OS.indent(FullIndexWidth + Indent*2) << " // Dst: "
+ OS.indent(FullIndexWidth + Indent) << " // Dst: "
<< *CM->getPattern().getDstPattern();
}
OS << '\n';