diff --git a/backends/p4tools/common/options.cpp b/backends/p4tools/common/options.cpp index f874f8b7c3e..bd47d0029cc 100644 --- a/backends/p4tools/common/options.cpp +++ b/backends/p4tools/common/options.cpp @@ -78,7 +78,7 @@ std::optional AbstractP4cToolOptions::process( } P4CContext::get().options().file = remainingArgs->at(0); - validate(); + validateOptions(); return compilerContext; } diff --git a/backends/p4tools/common/options.h b/backends/p4tools/common/options.h index 40b2caa96d8..bcf7816c31c 100644 --- a/backends/p4tools/common/options.h +++ b/backends/p4tools/common/options.h @@ -33,8 +33,8 @@ class AbstractP4cToolOptions : protected Util::Options { /// Hook for customizing options processing. std::vector *process(int argc, char *const argv[]) override; - /// Hook for validation of options after parsing. - virtual void validate() const {} + /// Checks if parsed options make sense with respect to each-other. + virtual void validateOptions() const {} /// Converts a vector of command-line arguments into the traditional (argc, argv) format. static std::tuple convertArgs(const std::vector &args); diff --git a/backends/p4tools/modules/testgen/options.cpp b/backends/p4tools/modules/testgen/options.cpp index e360a98b92e..548f6133075 100644 --- a/backends/p4tools/modules/testgen/options.cpp +++ b/backends/p4tools/modules/testgen/options.cpp @@ -383,7 +383,7 @@ TestgenOptions::TestgenOptions() "produce no tests or only tests that contain counter examples."); } -void TestgenOptions::validate() const { +void TestgenOptions::validateOptions() const { if (minCoverage > 0 && !hasCoverageTracking) { ::error( ErrorType::ERR_INVALID, diff --git a/backends/p4tools/modules/testgen/options.h b/backends/p4tools/modules/testgen/options.h index f8aa32bf233..5f3b0c77db2 100644 --- a/backends/p4tools/modules/testgen/options.h +++ b/backends/p4tools/modules/testgen/options.h @@ -93,7 +93,7 @@ class TestgenOptions : public AbstractP4cToolOptions { const char *getIncludePath() override; protected: - void validate() const override; + void validateOptions() const override; private: TestgenOptions();