mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not analyze unecessary contracts
This commit is contained in:
@@ -78,6 +78,9 @@ CHC::CHC(
|
||||
|
||||
void CHC::analyze(SourceUnit const& _source)
|
||||
{
|
||||
if (!shouldAnalyze(_source))
|
||||
return;
|
||||
|
||||
if (!m_settings.solvers.z3 && !m_settings.solvers.smtlib2)
|
||||
{
|
||||
if (!m_noSolverWarning)
|
||||
@@ -137,6 +140,9 @@ vector<string> CHC::unhandledQueries() const
|
||||
|
||||
bool CHC::visit(ContractDefinition const& _contract)
|
||||
{
|
||||
if (!shouldAnalyze(_contract))
|
||||
return false;
|
||||
|
||||
resetContractAnalysis();
|
||||
initContract(_contract);
|
||||
clearIndices(&_contract);
|
||||
@@ -152,6 +158,9 @@ bool CHC::visit(ContractDefinition const& _contract)
|
||||
|
||||
void CHC::endVisit(ContractDefinition const& _contract)
|
||||
{
|
||||
if (!shouldAnalyze(_contract))
|
||||
return;
|
||||
|
||||
for (auto base: _contract.annotation().linearizedBaseContracts)
|
||||
{
|
||||
if (auto constructor = base->constructor())
|
||||
|
||||
@@ -1035,6 +1035,12 @@ void SMTEncoder::visitPublicGetter(FunctionCall const& _funCall)
|
||||
}
|
||||
}
|
||||
|
||||
bool SMTEncoder::shouldAnalyze(SourceUnit const& _source) const
|
||||
{
|
||||
return m_settings.contracts.isDefault() ||
|
||||
m_settings.contracts.has(*_source.annotation().path);
|
||||
}
|
||||
|
||||
bool SMTEncoder::shouldAnalyze(ContractDefinition const& _contract) const
|
||||
{
|
||||
if (!_contract.canBeDeployed())
|
||||
|
||||
@@ -223,6 +223,8 @@ protected:
|
||||
/// @returns true if @param _contract is set for analysis in the settings
|
||||
/// and it is not abstract.
|
||||
bool shouldAnalyze(ContractDefinition const& _contract) const;
|
||||
/// @returns true if @param _source is set for analysis in the settings.
|
||||
bool shouldAnalyze(SourceUnit const& _source) const;
|
||||
|
||||
bool isPublicGetter(Expression const& _expr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user