From 0494fa98c0c973bf9e8b3dfa4873e1b5744e7715 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 21 Nov 2016 12:23:43 +0000 Subject: Add shift helper to CompilerUtils --- libsolidity/codegen/CompilerUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 0ee053a9..278f9302 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -176,6 +176,12 @@ public: static unsigned sizeOnStack(std::vector const& _variables); static unsigned sizeOnStack(std::vector> const& _variableTypes); + /// Helper function to shift top value on the stack to the left. + void leftShiftNumberOnStack(u256 _shiftFactor); + + /// Helper function to shift top value on the stack to the right. + void rightShiftNumberOnStack(u256 _shiftFactor, bool _isSigned = false); + /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); -- cgit v1.2.3 From 8fd1d4167d2d05363ecf6af7ada42da940199900 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Nov 2016 10:03:26 +0000 Subject: Change shiftNumberOnStack to bits --- libsolidity/codegen/CompilerUtils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 278f9302..fb169463 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -177,10 +177,10 @@ public: static unsigned sizeOnStack(std::vector> const& _variableTypes); /// Helper function to shift top value on the stack to the left. - void leftShiftNumberOnStack(u256 _shiftFactor); + void leftShiftNumberOnStack(unsigned _bits); /// Helper function to shift top value on the stack to the right. - void rightShiftNumberOnStack(u256 _shiftFactor, bool _isSigned = false); + 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(); -- cgit v1.2.3