aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerContext.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-01-17 17:47:57 +0800
committerchriseth <c@ethdev.com>2017-01-24 19:06:40 +0800
commitd0e8d340a53395de4c83e4e1d6ccf4c8eab5889a (patch)
treef6f6e7f2e4190e2ca959b6308bbc32d58161cbc3 /libsolidity/codegen/CompilerContext.cpp
parentdea59bfbdc610b65018b613dc20322d98e9aa2b6 (diff)
downloaddexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar.gz
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar.bz2
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar.lz
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar.xz
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.tar.zst
dexon-solidity-d0e8d340a53395de4c83e4e1d6ccf4c8eab5889a.zip
Low level named functions for CompilerContext.
Diffstat (limited to 'libsolidity/codegen/CompilerContext.cpp')
-rw-r--r--libsolidity/codegen/CompilerContext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp
index c14ab845..fcd39b33 100644
--- a/libsolidity/codegen/CompilerContext.cpp
+++ b/libsolidity/codegen/CompilerContext.cpp
@@ -125,6 +125,21 @@ Declaration const* CompilerContext::nextFunctionToCompile() const
return m_functionCompilationQueue.nextFunctionToCompile();
}
+eth::AssemblyItem const* CompilerContext::lowLevelFunctionEntryPoint(string const& _name) const
+{
+ auto it = m_lowLevelFunctions.find(_name);
+ if (it == m_lowLevelFunctions.end())
+ return nullptr;
+ else
+ return *it;
+}
+
+void CompilerContext::addLowLevelFunction(string const& _name, eth::AssemblyItem const& _label)
+{
+ solAssert(lowLevelFunctionEntryPoint(_name) != nullptr, "Low level function with that name already exists.");
+ m_lowLevelFunctions[_name] = _label.pushTag();
+}
+
ModifierDefinition const& CompilerContext::functionModifier(string const& _name) const
{
solAssert(!m_inheritanceHierarchy.empty(), "No inheritance hierarchy set.");