diff options
author | chriseth <chris@ethereum.org> | 2017-07-03 17:25:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 17:25:04 +0800 |
commit | 0c7530a8529c5cb45e1b349dc700923b2e685dfc (patch) | |
tree | 39ef837613d1362574a890d92db035df0b00573d /libsolidity/codegen/CompilerUtils.h | |
parent | d230048dc8385744203528115aa9bb5c0fba4339 (diff) | |
parent | 677700d5ac1c5079aa20a6a9e5667c7e8596da27 (diff) | |
download | dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.gz dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.bz2 dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.lz dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.xz dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.zst dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.zip |
Merge pull request #2499 from ethereum/shift-helper
Add shift helper to CompilerUtils
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.h')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 0ee053a9..fb169463 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -176,6 +176,12 @@ public: static unsigned sizeOnStack(std::vector<T> const& _variables); static unsigned sizeOnStack(std::vector<std::shared_ptr<Type const>> const& _variableTypes); + /// Helper function to shift top value on the stack to the left. + void leftShiftNumberOnStack(unsigned _bits); + + /// Helper function to shift top value on the stack to the right. + void rightShiftNumberOnStack(unsigned _bits, bool _isSigned = false); + /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); |