Merge pull request #6336 from ethereum/compilerstack-addsource

Removed unused isLibrary from flag addSource in CompilerStack
This commit is contained in:
Alex Beregszaszi 2019-03-20 18:12:16 +00:00 committed by GitHub
commit e3c1dea97c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -160,12 +160,11 @@ void CompilerStack::reset(bool _keepSources)
m_errorReporter.clear();
}
bool CompilerStack::addSource(string const& _name, string const& _content, bool _isLibrary)
bool CompilerStack::addSource(string const& _name, string const& _content)
{
bool existed = m_sources.count(_name) != 0;
reset(true);
m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content, _name));
m_sources[_name].isLibrary = _isLibrary;
m_stackState = SourcesSet;
return existed;
}
@ -828,8 +827,7 @@ void CompilerStack::resolveImports()
};
for (auto const& sourcePair: m_sources)
if (!sourcePair.second.isLibrary)
toposort(&sourcePair.second);
toposort(&sourcePair.second);
swap(m_sourceOrder, sourceOrder);
}

View File

@ -150,7 +150,7 @@ public:
/// Adds a source object (e.g. file) to the parser. After this, parse has to be called again.
/// @returns true if a source object by the name already existed and was replaced.
bool addSource(std::string const& _name, std::string const& _content, bool _isLibrary = false);
bool addSource(std::string const& _name, std::string const& _content);
/// Adds a response to an SMTLib2 query (identified by the hash of the query input).
/// Must be set before parsing.
@ -261,7 +261,6 @@ private:
{
std::shared_ptr<langutil::Scanner> scanner;
std::shared_ptr<SourceUnit> ast;
bool isLibrary = false;
h256 mutable keccak256HashCached;
h256 mutable swarmHashCached;
void reset() { *this = Source(); }