@@ -1069,42 +1069,42 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
1069
1069
DwoOS->keep ();
1070
1070
}
1071
1071
1072
- static PassBuilder:: OptimizationLevel mapToLevel (const CodeGenOptions &Opts) {
1072
+ static OptimizationLevel mapToLevel (const CodeGenOptions &Opts) {
1073
1073
switch (Opts.OptimizationLevel ) {
1074
1074
default :
1075
1075
llvm_unreachable (" Invalid optimization level!" );
1076
1076
1077
1077
case 0 :
1078
- return PassBuilder:: OptimizationLevel::O0;
1078
+ return OptimizationLevel::O0;
1079
1079
1080
1080
case 1 :
1081
- return PassBuilder:: OptimizationLevel::O1;
1081
+ return OptimizationLevel::O1;
1082
1082
1083
1083
case 2 :
1084
1084
switch (Opts.OptimizeSize ) {
1085
1085
default :
1086
1086
llvm_unreachable (" Invalid optimization level for size!" );
1087
1087
1088
1088
case 0 :
1089
- return PassBuilder:: OptimizationLevel::O2;
1089
+ return OptimizationLevel::O2;
1090
1090
1091
1091
case 1 :
1092
- return PassBuilder:: OptimizationLevel::Os;
1092
+ return OptimizationLevel::Os;
1093
1093
1094
1094
case 2 :
1095
- return PassBuilder:: OptimizationLevel::Oz;
1095
+ return OptimizationLevel::Oz;
1096
1096
}
1097
1097
1098
1098
case 3 :
1099
- return PassBuilder:: OptimizationLevel::O3;
1099
+ return OptimizationLevel::O3;
1100
1100
}
1101
1101
}
1102
1102
1103
1103
static void addSanitizers (const Triple &TargetTriple,
1104
1104
const CodeGenOptions &CodeGenOpts,
1105
1105
const LangOptions &LangOpts, PassBuilder &PB) {
1106
1106
PB.registerOptimizerLastEPCallback ([&](ModulePassManager &MPM,
1107
- PassBuilder:: OptimizationLevel Level) {
1107
+ OptimizationLevel Level) {
1108
1108
if (CodeGenOpts.hasSanitizeCoverage ()) {
1109
1109
auto SancovOpts = getSancovOptsFromCGOpts (CodeGenOpts);
1110
1110
MPM.addPass (ModuleSanitizerCoveragePass (
@@ -1122,7 +1122,7 @@ static void addSanitizers(const Triple &TargetTriple,
1122
1122
FunctionPassManager FPM;
1123
1123
FPM.addPass (
1124
1124
MemorySanitizerPass ({TrackOrigins, Recover, CompileKernel}));
1125
- if (Level != PassBuilder:: OptimizationLevel::O0) {
1125
+ if (Level != OptimizationLevel::O0) {
1126
1126
// MemorySanitizer inserts complex instrumentation that mostly
1127
1127
// follows the logic of the original code, but operates on
1128
1128
// "shadow" values. It can benefit from re-running some
@@ -1325,26 +1325,26 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
1325
1325
if (!CodeGenOpts.DisableLLVMPasses ) {
1326
1326
// Map our optimization levels into one of the distinct levels used to
1327
1327
// configure the pipeline.
1328
- PassBuilder:: OptimizationLevel Level = mapToLevel (CodeGenOpts);
1328
+ OptimizationLevel Level = mapToLevel (CodeGenOpts);
1329
1329
1330
1330
bool IsThinLTO = CodeGenOpts.PrepareForThinLTO ;
1331
1331
bool IsLTO = CodeGenOpts.PrepareForLTO ;
1332
1332
1333
1333
if (LangOpts.ObjCAutoRefCount ) {
1334
1334
PB.registerPipelineStartEPCallback (
1335
- [](ModulePassManager &MPM, PassBuilder:: OptimizationLevel Level) {
1336
- if (Level != PassBuilder:: OptimizationLevel::O0)
1335
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
1336
+ if (Level != OptimizationLevel::O0)
1337
1337
MPM.addPass (
1338
1338
createModuleToFunctionPassAdaptor (ObjCARCExpandPass ()));
1339
1339
});
1340
1340
PB.registerPipelineEarlySimplificationEPCallback (
1341
- [](ModulePassManager &MPM, PassBuilder:: OptimizationLevel Level) {
1342
- if (Level != PassBuilder:: OptimizationLevel::O0)
1341
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
1342
+ if (Level != OptimizationLevel::O0)
1343
1343
MPM.addPass (ObjCARCAPElimPass ());
1344
1344
});
1345
1345
PB.registerScalarOptimizerLateEPCallback (
1346
- [](FunctionPassManager &FPM, PassBuilder:: OptimizationLevel Level) {
1347
- if (Level != PassBuilder:: OptimizationLevel::O0)
1346
+ [](FunctionPassManager &FPM, OptimizationLevel Level) {
1347
+ if (Level != OptimizationLevel::O0)
1348
1348
FPM.addPass (ObjCARCOptPass ());
1349
1349
});
1350
1350
}
@@ -1357,7 +1357,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
1357
1357
// vtables so that codegen doesn't complain.
1358
1358
if (IsThinLTOPostLink)
1359
1359
PB.registerPipelineStartEPCallback (
1360
- [](ModulePassManager &MPM, PassBuilder:: OptimizationLevel Level) {
1360
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
1361
1361
MPM.addPass (LowerTypeTestsPass (/* ExportSummary=*/ nullptr ,
1362
1362
/* ImportSummary=*/ nullptr ,
1363
1363
/* DropTypeTests=*/ true ));
@@ -1368,12 +1368,12 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
1368
1368
CodeGenOpts.InstrumentFunctionsAfterInlining ||
1369
1369
CodeGenOpts.InstrumentForProfiling ) {
1370
1370
PB.registerPipelineStartEPCallback (
1371
- [](ModulePassManager &MPM, PassBuilder:: OptimizationLevel Level) {
1371
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
1372
1372
MPM.addPass (createModuleToFunctionPassAdaptor (
1373
1373
EntryExitInstrumenterPass (/* PostInlining=*/ false )));
1374
1374
});
1375
1375
PB.registerOptimizerLastEPCallback (
1376
- [](ModulePassManager &MPM, PassBuilder:: OptimizationLevel Level) {
1376
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
1377
1377
MPM.addPass (createModuleToFunctionPassAdaptor (
1378
1378
EntryExitInstrumenterPass (/* PostInlining=*/ true )));
1379
1379
});
@@ -1383,7 +1383,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
1383
1383
// of the pipeline.
1384
1384
if (LangOpts.Sanitize .has (SanitizerKind::LocalBounds))
1385
1385
PB.registerScalarOptimizerLateEPCallback (
1386
- [](FunctionPassManager &FPM, PassBuilder:: OptimizationLevel Level) {
1386
+ [](FunctionPassManager &FPM, OptimizationLevel Level) {
1387
1387
FPM.addPass (BoundsCheckingPass ());
1388
1388
});
1389
1389
@@ -1394,15 +1394,13 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
1394
1394
1395
1395
if (Optional<GCOVOptions> Options = getGCOVOptions (CodeGenOpts, LangOpts))
1396
1396
PB.registerPipelineStartEPCallback (
1397
- [Options](ModulePassManager &MPM,
1398
- PassBuilder::OptimizationLevel Level) {
1397
+ [Options](ModulePassManager &MPM, OptimizationLevel Level) {
1399
1398
MPM.addPass (GCOVProfilerPass (*Options));
1400
1399
});
1401
1400
if (Optional<InstrProfOptions> Options =
1402
1401
getInstrProfOptions (CodeGenOpts, LangOpts))
1403
1402
PB.registerPipelineStartEPCallback (
1404
- [Options](ModulePassManager &MPM,
1405
- PassBuilder::OptimizationLevel Level) {
1403
+ [Options](ModulePassManager &MPM, OptimizationLevel Level) {
1406
1404
MPM.addPass (InstrProfiling (*Options, false ));
1407
1405
});
1408
1406
0 commit comments