[llvm] fdc1b5d - [NFC][opt] Rename VerifierKind enums (#106789)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 10:25:19 PDT 2024
Author: Arthur Eubanks
Date: 2024-09-03T10:25:16-07:00
New Revision: fdc1b5d290edfefe93c2bf0582e8e4363bda63ee
URL: https://github.com/llvm/llvm-project/commit/fdc1b5d290edfefe93c2bf0582e8e4363bda63ee
DIFF: https://github.com/llvm/llvm-project/commit/fdc1b5d290edfefe93c2bf0582e8e4363bda63ee.diff
LOG: [NFC][opt] Rename VerifierKind enums (#106789)
Make into enum class.
Output really should be InputOutput since it also verifies the input IR.
Added:
Modified:
llvm/tools/opt/NewPMDriver.cpp
llvm/tools/opt/NewPMDriver.h
llvm/tools/opt/optdriver.cpp
Removed:
################################################################################
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 91ec905e58f121..9a477193a29365 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -343,8 +343,6 @@ bool llvm::runPassPipeline(
bool ShouldPreserveBitcodeUseListOrder, bool EmitSummaryIndex,
bool EmitModuleHash, bool EnableDebugify, bool VerifyDIPreserve,
bool UnifiedLTO) {
- bool VerifyEachPass = VK == VK_VerifyEachPass;
-
auto FS = vfs::getRealFileSystem();
std::optional<PGOOptions> P;
switch (PGOKindFlag) {
@@ -410,7 +408,7 @@ bool llvm::runPassPipeline(
PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;
PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;
StandardInstrumentations SI(M.getContext(), DebugPM != DebugLogging::None,
- VerifyEachPass, PrintPassOpts);
+ VK == VerifierKind::EachPass, PrintPassOpts);
SI.registerCallbacks(PIC, &MAM);
DebugifyEachInstrumentation Debugify;
DebugifyStatsMap DIStatsMap;
@@ -483,7 +481,7 @@ bool llvm::runPassPipeline(
}
}
- if (VK > VK_NoVerifier)
+ if (VK != VerifierKind::None)
MPM.addPass(VerifierPass());
if (EnableDebugify)
MPM.addPass(NewPMCheckDebugifyPass(false, "", &DIStatsMap));
diff --git a/llvm/tools/opt/NewPMDriver.h b/llvm/tools/opt/NewPMDriver.h
index 19cabd15436ebe..2daae571e72c27 100644
--- a/llvm/tools/opt/NewPMDriver.h
+++ b/llvm/tools/opt/NewPMDriver.h
@@ -44,7 +44,7 @@ enum OutputKind {
OK_OutputBitcode,
OK_OutputThinLTOBitcode,
};
-enum VerifierKind { VK_NoVerifier, VK_VerifyOut, VK_VerifyEachPass };
+enum class VerifierKind { None, InputOutput, EachPass };
enum PGOKind {
NoPGO,
InstrGen,
diff --git a/llvm/tools/opt/optdriver.cpp b/llvm/tools/opt/optdriver.cpp
index eb4821d5214051..1bdfa71830ba22 100644
--- a/llvm/tools/opt/optdriver.cpp
+++ b/llvm/tools/opt/optdriver.cpp
@@ -726,11 +726,11 @@ extern "C" int optMain(
? OK_OutputAssembly
: (OutputThinLTOBC ? OK_OutputThinLTOBitcode : OK_OutputBitcode);
- VerifierKind VK = VK_VerifyOut;
+ VerifierKind VK = VerifierKind::InputOutput;
if (NoVerify)
- VK = VK_NoVerifier;
+ VK = VerifierKind::None;
else if (VerifyEach)
- VK = VK_VerifyEachPass;
+ VK = VerifierKind::EachPass;
// The user has asked to use the new pass manager and provided a pipeline
// string. Hand off the rest of the functionality to the new code for that
More information about the llvm-commits
mailing list