aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-11 00:15:17 +0800
committerChristian <c@ethdev.com>2014-12-11 00:15:17 +0800
commit373f0da2675f298984f265672d7414a58c061512 (patch)
tree72cf9741f01020410d10d07103d82714a4383bd0 /CompilerUtils.h
parent130ff85e85de3ea8a9666f84843428a3a09b1aab (diff)
downloaddexon-solidity-373f0da2675f298984f265672d7414a58c061512.tar.gz
dexon-solidity-373f0da2675f298984f265672d7414a58c061512.tar.zst
dexon-solidity-373f0da2675f298984f265672d7414a58c061512.zip
Helper functions to access memory.
Diffstat (limited to 'CompilerUtils.h')
-rw-r--r--CompilerUtils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/CompilerUtils.h b/CompilerUtils.h
index 4da53375..928f0e2d 100644
--- a/CompilerUtils.h
+++ b/CompilerUtils.h
@@ -35,6 +35,18 @@ class CompilerUtils
public:
CompilerUtils(CompilerContext& _context): m_context(_context) {}
+ /// Loads data from memory to the stack.
+ /// @param _offset offset in memory (or calldata)
+ /// @param _bytes number of bytes to load
+ /// @param _leftAligned if true, store left aligned on stack (otherwise right aligned)
+ /// @param _fromCalldata if true, load from calldata, not from memory
+ void loadFromMemory(unsigned _offset, unsigned _bytes = 32, bool _leftAligned = false, bool _fromCalldata = false);
+ /// Stores data from stack in memory.
+ /// @param _offset offset in memory
+ /// @param _bytes number of bytes to store
+ /// @param _leftAligned if true, data is left aligned on stack (otherwise right aligned)
+ void storeInMemory(unsigned _offset, unsigned _bytes = 32, bool _leftAligned = false);
+
/// Moves the value that is at the top of the stack to a stack variable.
void moveToStackVariable(VariableDeclaration const& _variable);
/// Copies a variable of type @a _type from a stack depth of @a _stackDepth to the top of the stack.