aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/AsmAnalysis.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-03 22:49:23 +0800
committerchriseth <chris@ethereum.org>2018-12-04 19:06:33 +0800
commit99db4e3ff45c2a8d5d9c645774f099b82b7618ec (patch)
tree9f61e6b6192141bf9233f49a4a2c36e5c26ca8df /libyul/AsmAnalysis.cpp
parente49f37be7f64d0306c2e63cea81eb98aa1bc85f1 (diff)
downloaddexon-solidity-99db4e3ff45c2a8d5d9c645774f099b82b7618ec.tar.gz
dexon-solidity-99db4e3ff45c2a8d5d9c645774f099b82b7618ec.tar.zst
dexon-solidity-99db4e3ff45c2a8d5d9c645774f099b82b7618ec.zip
Introduce the concept of builtin functions.
Diffstat (limited to 'libyul/AsmAnalysis.cpp')
-rw-r--r--libyul/AsmAnalysis.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp
index d2efdd9f..5215e5c2 100644
--- a/libyul/AsmAnalysis.cpp
+++ b/libyul/AsmAnalysis.cpp
@@ -101,7 +101,7 @@ bool AsmAnalyzer::operator()(Literal const& _literal)
}
else if (_literal.kind == LiteralKind::Boolean)
{
- solAssert(m_flavour == AsmFlavour::Yul, "");
+ solAssert(m_dialect.flavour == AsmFlavour::Yul, "");
solAssert(_literal.value == YulString{string("true")} || _literal.value == YulString{string("false")}, "");
}
m_info.stackHeightInfo[&_literal] = m_stackHeight;
@@ -164,7 +164,7 @@ bool AsmAnalyzer::operator()(Identifier const& _identifier)
bool AsmAnalyzer::operator()(FunctionalInstruction const& _instr)
{
- solAssert(m_flavour != AsmFlavour::Yul, "");
+ solAssert(m_dialect.flavour != AsmFlavour::Yul, "");
bool success = true;
for (auto const& arg: _instr.arguments | boost::adaptors::reversed)
if (!expectExpression(arg))
@@ -182,9 +182,9 @@ bool AsmAnalyzer::operator()(ExpressionStatement const& _statement)
{
int initialStackHeight = m_stackHeight;
bool success = boost::apply_visitor(*this, _statement.expression);
- if (m_stackHeight != initialStackHeight && (m_flavour != AsmFlavour::Loose || m_errorTypeForLoose))
+ if (m_stackHeight != initialStackHeight && (m_dialect.flavour != AsmFlavour::Loose || m_errorTypeForLoose))
{
- Error::Type errorType = m_flavour == AsmFlavour::Loose ? *m_errorTypeForLoose : Error::Type::TypeError;
+ Error::Type errorType = m_dialect.flavour == AsmFlavour::Loose ? *m_errorTypeForLoose : Error::Type::TypeError;
string msg =
"Top-level expressions are not supposed to return values (this expression returns " +
to_string(m_stackHeight - initialStackHeight) +
@@ -563,7 +563,7 @@ Scope& AsmAnalyzer::scope(Block const* _block)
}
void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _location)
{
- if (m_flavour != AsmFlavour::Yul)
+ if (m_dialect.flavour != AsmFlavour::Yul)
return;
if (!builtinTypes.count(type))
@@ -623,7 +623,7 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI || _instr == solidity::Instruction::JUMPDEST)
{
- solAssert(m_flavour == AsmFlavour::Loose, "");
+ solAssert(m_dialect.flavour == AsmFlavour::Loose, "");
m_errorReporter.error(
m_errorTypeForLoose ? *m_errorTypeForLoose : Error::Type::Warning,
_location,
@@ -636,7 +636,7 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
void AsmAnalyzer::checkLooseFeature(SourceLocation const& _location, string const& _description)
{
- if (m_flavour != AsmFlavour::Loose)
+ if (m_dialect.flavour != AsmFlavour::Loose)
solAssert(false, _description);
else if (m_errorTypeForLoose)
m_errorReporter.error(*m_errorTypeForLoose, _location, _description);