mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove duplicate work from CompilerStack.analyze()
This commit is contained in:
parent
92ef30b748
commit
d60d4b3031
@ -201,8 +201,6 @@ bool CompilerStack::analyze()
|
|||||||
for (ASTPointer<ASTNode> const& node: source->ast->nodes())
|
for (ASTPointer<ASTNode> const& node: source->ast->nodes())
|
||||||
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
|
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
|
||||||
{
|
{
|
||||||
m_globalContext->setCurrentContract(*contract);
|
|
||||||
resolver.updateDeclaration(*m_globalContext->currentThis());
|
|
||||||
TypeChecker typeChecker(m_errorReporter);
|
TypeChecker typeChecker(m_errorReporter);
|
||||||
if (typeChecker.checkTypeRequirements(*contract))
|
if (typeChecker.checkTypeRequirements(*contract))
|
||||||
{
|
{
|
||||||
@ -211,14 +209,6 @@ bool CompilerStack::analyze()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
noErrors = false;
|
noErrors = false;
|
||||||
|
|
||||||
// Note that we now reference contracts by their fully qualified names, and
|
|
||||||
// thus contracts can only conflict if declared in the same source file. This
|
|
||||||
// already causes a double-declaration error elsewhere, so we do not report
|
|
||||||
// an error here and instead silently drop any additional contracts we find.
|
|
||||||
|
|
||||||
if (m_contracts.find(contract->fullyQualifiedName()) == m_contracts.end())
|
|
||||||
m_contracts[contract->fullyQualifiedName()].contract = contract;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noErrors)
|
if (noErrors)
|
||||||
|
Loading…
Reference in New Issue
Block a user