From 2e6cbd87182b7960db1cb36158b6a7978f9c2649 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 2 Jul 2020 18:34:39 +0100 Subject: [PATCH] Rename warnOnInstructions to validateInstructions --- libyul/AsmAnalysis.cpp | 10 +++++----- libyul/AsmAnalysis.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index ebc43b42f..c7e825759 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -264,7 +264,7 @@ vector AsmAnalyzer::operator()(FunctionCall const& _funCall) if (f->literalArguments) needsLiteralArguments = &f->literalArguments.value(); - warnOnInstructions(_funCall); + validateInstructions(_funCall); } else if (!m_currentScope->lookup(_funCall.functionName.name, GenericVisitor{ [&](Scope::Variable const&) @@ -282,7 +282,7 @@ vector AsmAnalyzer::operator()(FunctionCall const& _funCall) } })) { - if (!warnOnInstructions(_funCall)) + if (!validateInstructions(_funCall)) m_errorReporter.declarationError(4619_error, _funCall.functionName.location, "Function not found."); yulAssert(!watcher.ok(), "Expected a reported error."); } @@ -541,16 +541,16 @@ void AsmAnalyzer::expectType(YulString _expectedType, YulString _givenType, Sour ); } -bool AsmAnalyzer::warnOnInstructions(std::string const& _instructionIdentifier, langutil::SourceLocation const& _location) +bool AsmAnalyzer::validateInstructions(std::string const& _instructionIdentifier, langutil::SourceLocation const& _location) { auto const builtin = EVMDialect::strictAssemblyForEVM(EVMVersion{}).builtin(YulString(_instructionIdentifier)); if (builtin && builtin->instruction.has_value()) - return warnOnInstructions(builtin->instruction.value(), _location); + return validateInstructions(builtin->instruction.value(), _location); else return false; } -bool AsmAnalyzer::warnOnInstructions(evmasm::Instruction _instr, SourceLocation const& _location) +bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocation const& _location) { // We assume that returndatacopy, returndatasize and staticcall are either all available // or all not available. diff --git a/libyul/AsmAnalysis.h b/libyul/AsmAnalysis.h index 29bfca2fd..e0a751b13 100644 --- a/libyul/AsmAnalysis.h +++ b/libyul/AsmAnalysis.h @@ -110,12 +110,12 @@ private: Scope& scope(Block const* _block); void expectValidType(YulString _type, langutil::SourceLocation const& _location); void expectType(YulString _expectedType, YulString _givenType, langutil::SourceLocation const& _location); - bool warnOnInstructions(evmasm::Instruction _instr, langutil::SourceLocation const& _location); - bool warnOnInstructions(std::string const& _instrIdentifier, langutil::SourceLocation const& _location); - bool warnOnInstructions(FunctionCall const& _functionCall) + bool validateInstructions(evmasm::Instruction _instr, langutil::SourceLocation const& _location); + bool validateInstructions(std::string const& _instrIdentifier, langutil::SourceLocation const& _location); + bool validateInstructions(FunctionCall const& _functionCall) { - return warnOnInstructions(_functionCall.functionName.name.str(), _functionCall.functionName.location); + return validateInstructions(_functionCall.functionName.name.str(), _functionCall.functionName.location); } yul::ExternalIdentifierAccess::Resolver m_resolver;