mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use experimental feature pragma for SMT checker.
This commit is contained in:
parent
75f09f2a84
commit
c93f0434cd
@ -29,6 +29,7 @@ namespace solidity
|
|||||||
|
|
||||||
enum class ExperimentalFeature
|
enum class ExperimentalFeature
|
||||||
{
|
{
|
||||||
|
SMTChecker,
|
||||||
ABIEncoderV2, // new ABI encoder that makes use of JULIA
|
ABIEncoderV2, // new ABI encoder that makes use of JULIA
|
||||||
Test,
|
Test,
|
||||||
TestOnlyAnalysis
|
TestOnlyAnalysis
|
||||||
@ -36,11 +37,13 @@ enum class ExperimentalFeature
|
|||||||
|
|
||||||
static const std::map<ExperimentalFeature, bool> ExperimentalFeatureOnlyAnalysis =
|
static const std::map<ExperimentalFeature, bool> ExperimentalFeatureOnlyAnalysis =
|
||||||
{
|
{
|
||||||
|
{ ExperimentalFeature::SMTChecker, true },
|
||||||
{ ExperimentalFeature::TestOnlyAnalysis, true },
|
{ ExperimentalFeature::TestOnlyAnalysis, true },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames =
|
static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames =
|
||||||
{
|
{
|
||||||
|
{ "SMTChecker", ExperimentalFeature::SMTChecker },
|
||||||
{ "ABIEncoderV2", ExperimentalFeature::ABIEncoderV2 },
|
{ "ABIEncoderV2", ExperimentalFeature::ABIEncoderV2 },
|
||||||
{ "__test", ExperimentalFeature::Test },
|
{ "__test", ExperimentalFeature::Test },
|
||||||
{ "__testOnlyAnalysis", ExperimentalFeature::TestOnlyAnalysis },
|
{ "__testOnlyAnalysis", ExperimentalFeature::TestOnlyAnalysis },
|
||||||
|
@ -44,12 +44,7 @@ SMTChecker::SMTChecker(ErrorReporter& _errorReporter, ReadCallback::Callback con
|
|||||||
|
|
||||||
void SMTChecker::analyze(SourceUnit const& _source)
|
void SMTChecker::analyze(SourceUnit const& _source)
|
||||||
{
|
{
|
||||||
bool pragmaFound = false;
|
if (_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker))
|
||||||
for (auto const& node: _source.nodes())
|
|
||||||
if (auto const* pragma = dynamic_cast<PragmaDirective const*>(node.get()))
|
|
||||||
if (pragma->literals()[0] == "checkAssertions")
|
|
||||||
pragmaFound = true;
|
|
||||||
if (pragmaFound)
|
|
||||||
{
|
{
|
||||||
m_interface->reset();
|
m_interface->reset();
|
||||||
m_currentSequenceCounter.clear();
|
m_currentSequenceCounter.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user