From e6f55fb95e913a5167ebd1f43a0eebb8b6d17daf Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 25 Aug 2017 15:43:26 +0100 Subject: Do not create a new TypeChecker instance for every contract --- libsolidity/interface/CompilerStack.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libsolidity/interface') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 1f6fd12f..7e4518b9 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -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 const& node: source->ast->nodes()) if (ContractDefinition* contract = dynamic_cast(node.get())) - { - TypeChecker typeChecker(m_errorReporter); if (!typeChecker.checkTypeRequirements(*contract)) noErrors = false; - } if (noErrors) { -- cgit