Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandLineParser #11518

Merged
merged 5 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions libsolidity/formal/ModelCheckerSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ struct ModelCheckerContracts
return has(_source) && contracts.at(_source).count(_contract);
}

bool operator!=(ModelCheckerContracts const& _other) const noexcept { return !(*this == _other); }
bool operator==(ModelCheckerContracts const& _other) const noexcept { return contracts == _other.contracts; }

/// Represents which contracts should be analyzed by the SMTChecker
/// as the most derived.
/// The key is the source file. If the map is empty, all sources must be analyzed.
Expand Down Expand Up @@ -79,6 +82,9 @@ struct ModelCheckerEngine
return engineMap.at(_engine);
return {};
}

bool operator!=(ModelCheckerEngine const& _other) const noexcept { return !(*this == _other); }
bool operator==(ModelCheckerEngine const& _other) const noexcept { return bmc == _other.bmc && chc == _other.chc; }
};

enum class VerificationTargetType { ConstantCondition, Underflow, Overflow, UnderOverflow, DivByZero, Balance, Assert, PopEmptyArray, OutOfBounds };
Expand All @@ -97,6 +103,9 @@ struct ModelCheckerTargets

static std::map<std::string, VerificationTargetType> const targetStrings;

bool operator!=(ModelCheckerTargets const& _other) const noexcept { return !(*this == _other); }
bool operator==(ModelCheckerTargets const& _other) const noexcept { return targets == _other.targets; }

std::set<VerificationTargetType> targets;
};

Expand All @@ -106,6 +115,16 @@ struct ModelCheckerSettings
ModelCheckerEngine engine = ModelCheckerEngine::None();
ModelCheckerTargets targets = ModelCheckerTargets::Default();
std::optional<unsigned> timeout;

bool operator!=(ModelCheckerSettings const& _other) const noexcept { return !(*this == _other); }
bool operator==(ModelCheckerSettings const& _other) const noexcept
{
return
contracts == _other.contracts &&
engine == _other.engine &&
targets == _other.targets &&
timeout == _other.timeout;
}
};

}
9 changes: 9 additions & 0 deletions libsolidity/interface/ImportRemapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ class ImportRemapper
public:
struct Remapping
{
bool operator!=(Remapping const& _other) const noexcept { return !(*this == _other); }
bool operator==(Remapping const& _other) const noexcept
{
return
context == _other.context &&
prefix == _other.prefix &&
target == _other.target;
}

std::string context;
std::string prefix;
std::string target;
Expand Down
1 change: 1 addition & 0 deletions solc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(libsolcli_sources
CommandLineInterface.cpp CommandLineInterface.h
CommandLineParser.cpp CommandLineParser.h
)

add_library(solcli ${libsolcli_sources})
Expand Down
Loading