1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[TableGen] Improve the formatting of the emitted predicates (NFC)

llvm-svn: 348226
This commit is contained in:
Evandro Menezes 2018-12-04 01:43:22 +00:00
parent 40b67df867
commit 2e9d1ca0b4

View File

@ -391,10 +391,10 @@ void InstrInfoEmitter::emitMCIIHelperMethods(raw_ostream &OS,
OS.indent(PE.getIndentLevel() * 2);
PE.expandStatement(OS, Rec->getValueAsDef("Body"));
OS << "\n}\n";
OS << "\n}\n\n";
}
OS << "\n} // end " << TargetName << "_MC namespace\n";
OS << "} // end " << TargetName << "_MC namespace\n";
OS << "} // end llvm namespace\n\n";
OS << "#endif // GET_GENISTRINFO_MC_HELPERS\n";
@ -409,10 +409,9 @@ void InstrInfoEmitter::emitTIIHelperMethods(raw_ostream &OS,
PredicateExpander PE(TargetName);
PE.setExpandForMC(false);
PE.setIndentLevel(2);
for (const Record *Rec : TIIPredicates) {
OS << "\n " << (ExpandDefinition ? "" : "static ") << "bool ";
OS << (ExpandDefinition ? "" : "static ") << "bool ";
if (ExpandDefinition)
OS << TargetName << "InstrInfo::";
OS << Rec->getValueAsString("FunctionName");
@ -423,10 +422,9 @@ void InstrInfoEmitter::emitTIIHelperMethods(raw_ostream &OS,
}
OS << " {\n";
OS.indent(PE.getIndentLevel() * 2);
PE.expandStatement(OS, Rec->getValueAsDef("Body"));
OS << "\n }\n";
OS << "\n}\n\n";
}
}
@ -534,12 +532,13 @@ void InstrInfoEmitter::run(raw_ostream &OS) {
OS << "#endif // GET_INSTRINFO_HEADER\n\n";
OS << "#ifdef GET_INSTRINFO_HELPER_DECLS\n";
OS << "#undef GET_INSTRINFO_HELPER_DECLS\n";
OS << "#undef GET_INSTRINFO_HELPER_DECLS\n\n";
emitTIIHelperMethods(OS, TargetName, /* ExpandDefintion = */false);
OS << "\n";
OS << "#endif // GET_INSTRINFO_HELPER_DECLS\n\n";
OS << "#ifdef GET_INSTRINFO_HELPERS\n";
OS << "#undef GET_INSTRINFO_HELPERS\n";
OS << "#undef GET_INSTRINFO_HELPERS\n\n";
emitTIIHelperMethods(OS, TargetName, /* ExpandDefintion = */true);
OS << "#endif // GET_INSTRINFO_HELPERS\n\n";