Do not create a new TypeChecker instance for every contract

This commit is contained in:
Alex Beregszaszi 2017-08-25 15:43:26 +01:00
parent 670df8e874
commit e6f55fb95e

View File

@ -200,14 +200,12 @@ bool CompilerStack::analyze()
m_contracts[contract->fullyQualifiedName()].contract = contract;
}
TypeChecker typeChecker(m_errorReporter);
for (Source const* source: m_sourceOrder)
for (ASTPointer<ASTNode> const& node: source->ast->nodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
{
TypeChecker typeChecker(m_errorReporter);
if (!typeChecker.checkTypeRequirements(*contract))
noErrors = false;
}
if (noErrors)
{