diff options
-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"; |