mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change CompilerStack.reset to have keepSettings flag instead of keepSources
This commit is contained in:
parent
cca73f9354
commit
d6dda7279c
@ -135,24 +135,20 @@ void CompilerStack::addSMTLib2Response(h256 const& _hash, string const& _respons
|
|||||||
m_smtlib2Responses[_hash] = _response;
|
m_smtlib2Responses[_hash] = _response;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerStack::reset(bool _keepSources)
|
void CompilerStack::reset(bool _keepSettings)
|
||||||
{
|
{
|
||||||
if (_keepSources)
|
m_stackState = Empty;
|
||||||
{
|
m_sources.clear();
|
||||||
m_stackState = SourcesSet;
|
|
||||||
for (auto sourcePair: m_sources)
|
|
||||||
sourcePair.second.reset();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_stackState = Empty;
|
|
||||||
m_sources.clear();
|
|
||||||
}
|
|
||||||
m_smtlib2Responses.clear();
|
m_smtlib2Responses.clear();
|
||||||
m_unhandledSMTLib2Queries.clear();
|
m_unhandledSMTLib2Queries.clear();
|
||||||
m_libraries.clear();
|
if (!_keepSettings)
|
||||||
m_evmVersion = langutil::EVMVersion();
|
{
|
||||||
m_optimiserSettings = OptimiserSettings::minimal();
|
m_remappings.clear();
|
||||||
|
m_libraries.clear();
|
||||||
|
m_evmVersion = langutil::EVMVersion();
|
||||||
|
m_optimiserSettings = OptimiserSettings::minimal();
|
||||||
|
m_metadataLiteralSources = false;
|
||||||
|
}
|
||||||
m_globalContext.reset();
|
m_globalContext.reset();
|
||||||
m_scopes.clear();
|
m_scopes.clear();
|
||||||
m_sourceOrder.clear();
|
m_sourceOrder.clear();
|
||||||
|
@ -109,10 +109,9 @@ public:
|
|||||||
/// @returns the current state.
|
/// @returns the current state.
|
||||||
State state() const { return m_stackState; }
|
State state() const { return m_stackState; }
|
||||||
|
|
||||||
/// Resets the compiler to a state where the sources are not parsed or even removed.
|
/// Resets the compiler to an empty state. Unless @a _keepSettings is set to true,
|
||||||
/// Sets the state to SourcesSet if @a _keepSources is true, otherwise to Empty.
|
/// all settings are reset as well.
|
||||||
/// All settings, with the exception of remappings, are reset.
|
void reset(bool _keepSettings = false);
|
||||||
void reset(bool _keepSources = false);
|
|
||||||
|
|
||||||
// Parses a remapping of the format "context:prefix=target".
|
// Parses a remapping of the format "context:prefix=target".
|
||||||
static boost::optional<Remapping> parseRemapping(std::string const& _remapping);
|
static boost::optional<Remapping> parseRemapping(std::string const& _remapping);
|
||||||
|
Loading…
Reference in New Issue
Block a user