Skip to content

Commit fdc1b5d

Browse files
authored
[NFC][opt] Rename VerifierKind enums (#106789)
Make into enum class. Output really should be InputOutput since it also verifies the input IR.
1 parent e89bcfc commit fdc1b5d

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

llvm/tools/opt/NewPMDriver.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ bool llvm::runPassPipeline(
343343
bool ShouldPreserveBitcodeUseListOrder, bool EmitSummaryIndex,
344344
bool EmitModuleHash, bool EnableDebugify, bool VerifyDIPreserve,
345345
bool UnifiedLTO) {
346-
bool VerifyEachPass = VK == VK_VerifyEachPass;
347-
348346
auto FS = vfs::getRealFileSystem();
349347
std::optional<PGOOptions> P;
350348
switch (PGOKindFlag) {
@@ -410,7 +408,7 @@ bool llvm::runPassPipeline(
410408
PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;
411409
PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;
412410
StandardInstrumentations SI(M.getContext(), DebugPM != DebugLogging::None,
413-
VerifyEachPass, PrintPassOpts);
411+
VK == VerifierKind::EachPass, PrintPassOpts);
414412
SI.registerCallbacks(PIC, &MAM);
415413
DebugifyEachInstrumentation Debugify;
416414
DebugifyStatsMap DIStatsMap;
@@ -483,7 +481,7 @@ bool llvm::runPassPipeline(
483481
}
484482
}
485483

486-
if (VK > VK_NoVerifier)
484+
if (VK != VerifierKind::None)
487485
MPM.addPass(VerifierPass());
488486
if (EnableDebugify)
489487
MPM.addPass(NewPMCheckDebugifyPass(false, "", &DIStatsMap));

llvm/tools/opt/NewPMDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ enum OutputKind {
4444
OK_OutputBitcode,
4545
OK_OutputThinLTOBitcode,
4646
};
47-
enum VerifierKind { VK_NoVerifier, VK_VerifyOut, VK_VerifyEachPass };
47+
enum class VerifierKind { None, InputOutput, EachPass };
4848
enum PGOKind {
4949
NoPGO,
5050
InstrGen,

llvm/tools/opt/optdriver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,11 @@ extern "C" int optMain(
726726
? OK_OutputAssembly
727727
: (OutputThinLTOBC ? OK_OutputThinLTOBitcode : OK_OutputBitcode);
728728

729-
VerifierKind VK = VK_VerifyOut;
729+
VerifierKind VK = VerifierKind::InputOutput;
730730
if (NoVerify)
731-
VK = VK_NoVerifier;
731+
VK = VerifierKind::None;
732732
else if (VerifyEach)
733-
VK = VK_VerifyEachPass;
733+
VK = VerifierKind::EachPass;
734734

735735
// The user has asked to use the new pass manager and provided a pipeline
736736
// string. Hand off the rest of the functionality to the new code for that

0 commit comments

Comments
 (0)