From 66597207762cc8e26b26d06be96ae7f2ed73df09 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Tue, 10 Sep 2019 12:11:43 +0200 Subject: [PATCH] Assembly: Remove checkLooseFeature(...) from AsmAnalyzer. --- libyul/AsmAnalysis.cpp | 13 +------------ libyul/AsmAnalysis.h | 5 ----- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index 0163c1060..b2858d457 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -89,10 +89,7 @@ AsmAnalysisInfo AsmAnalyzer::analyzeStrictAssertCorrect(Dialect const& _dialect, bool AsmAnalyzer::operator()(yul::Instruction const& _instruction) { - checkLooseFeature( - _instruction.location, - "The use of non-functional instructions is disallowed. Please use functional notation instead." - ); + solAssert(false, "The use of non-functional instructions is disallowed. Please use functional notation instead."); auto const& info = instructionInfo(_instruction.instruction); m_stackHeight += info.ret - info.args; m_info.stackHeightInfo[&_instruction] = m_stackHeight; @@ -730,11 +727,3 @@ void AsmAnalyzer::warnOnInstructions(dev::eth::Instruction _instr, SourceLocatio ); } } - -void AsmAnalyzer::checkLooseFeature(SourceLocation const& _location, string const& _description) -{ - if (m_dialect.flavour != AsmFlavour::Loose) - solAssert(false, _description); - else if (m_errorTypeForLoose) - m_errorReporter.error(*m_errorTypeForLoose, _location, _description); -} diff --git a/libyul/AsmAnalysis.h b/libyul/AsmAnalysis.h index db11b47bd..43afe8bc2 100644 --- a/libyul/AsmAnalysis.h +++ b/libyul/AsmAnalysis.h @@ -110,11 +110,6 @@ private: void expectValidType(std::string const& type, langutil::SourceLocation const& _location); void warnOnInstructions(dev::eth::Instruction _instr, langutil::SourceLocation const& _location); - /// Depending on @a m_flavour and @a m_errorTypeForLoose, throws an internal compiler - /// exception (if the flavour is not Loose), reports an error/warning - /// (if m_errorTypeForLoose is set) or does nothing. - void checkLooseFeature(langutil::SourceLocation const& _location, std::string const& _description); - int m_stackHeight = 0; yul::ExternalIdentifierAccess::Resolver m_resolver; Scope* m_currentScope = nullptr;