diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-23 23:31:36 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-25 00:16:22 +0800 |
commit | 38cb123a82dfa0d77c7eb629dfb9307463548a12 (patch) | |
tree | 3f3ecdcdcf40dc7b0affbf72f22adc55ae38ff1b /CompilerContext.cpp | |
parent | 820ed2dfe17d93a586ba1519333bbe79cc6b9a9c (diff) | |
download | dexon-solidity-38cb123a82dfa0d77c7eb629dfb9307463548a12.tar.gz dexon-solidity-38cb123a82dfa0d77c7eb629dfb9307463548a12.tar.zst dexon-solidity-38cb123a82dfa0d77c7eb629dfb9307463548a12.zip |
Adding location information to assembly items
- In order to facilitate this addition we also now have a ScopeGuard
object used in the Compiler to set the currently visited node.
Diffstat (limited to 'CompilerContext.cpp')
-rw-r--r-- | CompilerContext.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/CompilerContext.cpp b/CompilerContext.cpp index 8d32a1a5..c599be5e 100644 --- a/CompilerContext.cpp +++ b/CompilerContext.cpp @@ -166,5 +166,33 @@ u256 CompilerContext::getStorageLocationOfVariable(const Declaration& _declarati return it->second; } +CompilerContext& CompilerContext::operator<<(eth::AssemblyItem _item) +{ + solAssert(m_visitedNodes.size() > 0, "No node on the visited stack"); + m_asm.append(_item); + return *this; +} + +CompilerContext& CompilerContext::operator<<(eth::Instruction _instruction) +{ + solAssert(m_visitedNodes.size() > 0, "No node on the visited stack"); + m_asm.append(_instruction); + return *this; +} + +CompilerContext& CompilerContext::operator<<(u256 const& _value) +{ + solAssert(m_visitedNodes.size() > 0, "No node on the visited stack"); + m_asm.append(_value); + return *this; +} + +CompilerContext& CompilerContext::operator<<(bytes const& _data) +{ + solAssert(m_visitedNodes.size() > 0, "No node on the visited stack"); + m_asm.append(_data); + return *this; +} + } } |