Assembly: Remove checkLooseFeature(...) from AsmAnalyzer.

This commit is contained in:
Christian Parpart 2019-09-10 12:11:43 +02:00
parent 3df5dbbca4
commit 6659720776
2 changed files with 1 additions and 17 deletions

View File

@ -89,10 +89,7 @@ AsmAnalysisInfo AsmAnalyzer::analyzeStrictAssertCorrect(Dialect const& _dialect,
bool AsmAnalyzer::operator()(yul::Instruction const& _instruction) bool AsmAnalyzer::operator()(yul::Instruction const& _instruction)
{ {
checkLooseFeature( solAssert(false, "The use of non-functional instructions is disallowed. Please use functional notation instead.");
_instruction.location,
"The use of non-functional instructions is disallowed. Please use functional notation instead."
);
auto const& info = instructionInfo(_instruction.instruction); auto const& info = instructionInfo(_instruction.instruction);
m_stackHeight += info.ret - info.args; m_stackHeight += info.ret - info.args;
m_info.stackHeightInfo[&_instruction] = m_stackHeight; 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);
}

View File

@ -110,11 +110,6 @@ private:
void expectValidType(std::string const& type, langutil::SourceLocation const& _location); void expectValidType(std::string const& type, langutil::SourceLocation const& _location);
void warnOnInstructions(dev::eth::Instruction _instr, 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; int m_stackHeight = 0;
yul::ExternalIdentifierAccess::Resolver m_resolver; yul::ExternalIdentifierAccess::Resolver m_resolver;
Scope* m_currentScope = nullptr; Scope* m_currentScope = nullptr;