@@ -443,14 +443,14 @@ void SubtargetEmitter::emitStageAndOperandCycleData(
443443 continue ;
444444
445445 StringRef Name = ProcModel.ItinsDef ->getName ();
446- OS << " \n // Functional units for \" " << Name << " \"\n " ;
447- NamespaceEmitter FUNamespace (OS, (Name + Twine (" FU" )).str ());
446+ {
447+ OS << " \n // Functional units for \" " << Name << " \"\n " ;
448+ NamespaceEmitter FUNamespace (OS, (Name + Twine (" FU" )).str ());
448449
449- for (const auto &[Idx, FU] : enumerate(FUs))
450- OS << " const InstrStage::FuncUnits " << FU->getName () << " = 1ULL << "
451- << Idx << " ;\n " ;
452-
453- FUNamespace.close ();
450+ for (const auto &[Idx, FU] : enumerate(FUs))
451+ OS << " const InstrStage::FuncUnits " << FU->getName () << " = 1ULL << "
452+ << Idx << " ;\n " ;
453+ }
454454
455455 ConstRecVec BPs = ProcModel.ItinsDef ->getValueAsListOfDefs (" BP" );
456456 if (BPs.empty ())
@@ -1941,13 +1941,14 @@ void SubtargetEmitter::parseFeaturesFunction(raw_ostream &OS) {
19411941}
19421942
19431943void SubtargetEmitter::emitGenMCSubtargetInfo (raw_ostream &OS) {
1944- NamespaceEmitter NS (OS, (Target + Twine (" _MC" )).str ());
1945- OS << " unsigned resolveVariantSchedClassImpl(unsigned SchedClass,\n "
1946- << " const MCInst *MI, const MCInstrInfo *MCII, "
1947- << " const MCSubtargetInfo &STI, unsigned CPUID) {\n " ;
1948- emitSchedModelHelpersImpl (OS, /* OnlyExpandMCPredicates */ true );
1949- OS << " }\n " ;
1950- NS.close ();
1944+ {
1945+ NamespaceEmitter NS (OS, (Target + Twine (" _MC" )).str ());
1946+ OS << " unsigned resolveVariantSchedClassImpl(unsigned SchedClass,\n "
1947+ << " const MCInst *MI, const MCInstrInfo *MCII, "
1948+ << " const MCSubtargetInfo &STI, unsigned CPUID) {\n " ;
1949+ emitSchedModelHelpersImpl (OS, /* OnlyExpandMCPredicates */ true );
1950+ OS << " }\n " ;
1951+ }
19511952
19521953 OS << " struct " << Target
19531954 << " GenMCSubtargetInfo : public MCSubtargetInfo {\n " ;
@@ -1983,15 +1984,15 @@ void SubtargetEmitter::emitGenMCSubtargetInfo(raw_ostream &OS) {
19831984}
19841985
19851986void SubtargetEmitter::emitMcInstrAnalysisPredicateFunctions (raw_ostream &OS) {
1986- IfDefEmitter IfDefDecls (OS, " GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS" );
1987-
19881987 STIPredicateExpander PE (Target, /* Indent=*/ 0 );
1989- PE.setExpandForMC (true );
1990- PE.setByRef (true );
1991- for (const STIPredicateFunction &Fn : SchedModels.getSTIPredicates ())
1992- PE.expandSTIPredicate (OS, Fn);
19931988
1994- IfDefDecls.close ();
1989+ {
1990+ IfDefEmitter IfDefDecls (OS, " GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS" );
1991+ PE.setExpandForMC (true );
1992+ PE.setByRef (true );
1993+ for (const STIPredicateFunction &Fn : SchedModels.getSTIPredicates ())
1994+ PE.expandSTIPredicate (OS, Fn);
1995+ }
19951996
19961997 IfDefEmitter IfDefDefs (OS, " GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS" );
19971998 std::string ClassPrefix = Target + " MCInstrAnalysis" ;
0 commit comments