Skip to content

Commit

Permalink
Use the same name for validator function as is in ParserOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
vlstill committed Dec 11, 2023
1 parent afe64d8 commit d57ba39
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backends/p4tools/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ std::optional<ICompileContext *> AbstractP4cToolOptions::process(
}
P4CContext::get().options().file = remainingArgs->at(0);

validate();
validateOptions();

return compilerContext;
}
Expand Down
4 changes: 2 additions & 2 deletions backends/p4tools/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class AbstractP4cToolOptions : protected Util::Options {
/// Hook for customizing options processing.
std::vector<const char *> *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<int, char **> convertArgs(const std::vector<const char *> &args);
Expand Down
2 changes: 1 addition & 1 deletion backends/p4tools/modules/testgen/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion backends/p4tools/modules/testgen/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TestgenOptions : public AbstractP4cToolOptions {
const char *getIncludePath() override;

protected:
void validate() const override;
void validateOptions() const override;

private:
TestgenOptions();
Expand Down

0 comments on commit d57ba39

Please sign in to comment.