diff options
author | Evandro Menezes <e.menezes@samsung.com> | 2018-12-04 01:43:22 +0000 |
---|---|---|
committer | Evandro Menezes <e.menezes@samsung.com> | 2018-12-04 01:43:22 +0000 |
commit | 0a583d2bfaad86a34979abc2b4630505c1f2cb37 (patch) | |
tree | 7c1a716bf5cbb0e447ee0649a38aa7d03a0f8b7d | |
parent | f32d29d57fb0c64ba56090e16bbe09aca60b5bb5 (diff) | |
download | bcm5719-llvm-0a583d2bfaad86a34979abc2b4630505c1f2cb37.tar.gz bcm5719-llvm-0a583d2bfaad86a34979abc2b4630505c1f2cb37.zip |
[TableGen] Improve the formatting of the emitted predicates (NFC)
llvm-svn: 348226
-rw-r--r-- | llvm/utils/TableGen/InstrInfoEmitter.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp index 92aea99f7a2..39d9e852638 100644 --- a/llvm/utils/TableGen/InstrInfoEmitter.cpp +++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp @@ -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"; |