aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmAnalysis.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-15 22:18:09 +0800
committerchriseth <chris@ethereum.org>2018-03-07 00:45:34 +0800
commitfd1662d1c49776232b491f1871391ad1cd90309a (patch)
treeb872f410a7d59c2f15e227c13422c9ab9405ad54 /libsolidity/inlineasm/AsmAnalysis.h
parent14b12ae7452388516d0c4eb833b0c83fe5156b44 (diff)
downloaddexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar.gz
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar.bz2
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar.lz
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar.xz
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.tar.zst
dexon-solidity-fd1662d1c49776232b491f1871391ad1cd90309a.zip
Warn about using loose inline assembly features as experimental 0.5.0 feature.
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.h')
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.h b/libsolidity/inlineasm/AsmAnalysis.h
index 867711c7..8d2a71f0 100644
--- a/libsolidity/inlineasm/AsmAnalysis.h
+++ b/libsolidity/inlineasm/AsmAnalysis.h
@@ -30,6 +30,7 @@
#include <libsolidity/inlineasm/AsmDataForward.h>
#include <boost/variant.hpp>
+#include <boost/optional.hpp>
#include <functional>
#include <memory>
@@ -56,9 +57,17 @@ public:
AsmAnalysisInfo& _analysisInfo,
ErrorReporter& _errorReporter,
EVMVersion _evmVersion,
+ boost::optional<Error::Type> _errorTypeForLoose,
AsmFlavour _flavour = AsmFlavour::Loose,
julia::ExternalIdentifierAccess::Resolver const& _resolver = julia::ExternalIdentifierAccess::Resolver()
- ): m_resolver(_resolver), m_info(_analysisInfo), m_errorReporter(_errorReporter), m_evmVersion(_evmVersion), m_flavour(_flavour) {}
+ ):
+ m_resolver(_resolver),
+ m_info(_analysisInfo),
+ m_errorReporter(_errorReporter),
+ m_evmVersion(_evmVersion),
+ m_flavour(_flavour),
+ m_errorTypeForLoose(_errorTypeForLoose)
+ {}
bool analyze(assembly::Block const& _block);
@@ -91,6 +100,11 @@ private:
void expectValidType(std::string const& type, SourceLocation const& _location);
void warnOnInstructions(solidity::Instruction _instr, 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(SourceLocation const& _location, std::string const& _description);
+
int m_stackHeight = 0;
julia::ExternalIdentifierAccess::Resolver m_resolver;
Scope* m_currentScope = nullptr;
@@ -101,6 +115,7 @@ private:
ErrorReporter& m_errorReporter;
EVMVersion m_evmVersion;
AsmFlavour m_flavour = AsmFlavour::Loose;
+ boost::optional<Error::Type> m_errorTypeForLoose;
};
}