diff options
author | chriseth <chris@ethereum.org> | 2018-07-12 19:01:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-12 19:01:15 +0800 |
commit | 576f3ef18c47c13b92e5b604d19f99018b0300b0 (patch) | |
tree | 3cf2e9c41606f6c2a599621297a8155e097333dc /libsolidity/codegen/CompilerContext.h | |
parent | c438b73f689b904152f4b8b636579317fb55e60a (diff) | |
parent | a18a475b1a6ba1ebcf235f322dec0e7ff3d3dcb0 (diff) | |
download | dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar.gz dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar.bz2 dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar.lz dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar.xz dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.tar.zst dexon-solidity-576f3ef18c47c13b92e5b604d19f99018b0300b0.zip |
Merge pull request #4083 from ethereum/variable_stack_slot
[BREAKING] Allocate local variables according to their scope
Diffstat (limited to 'libsolidity/codegen/CompilerContext.h')
-rw-r--r-- | libsolidity/codegen/CompilerContext.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h index 5776b5d1..3f357821 100644 --- a/libsolidity/codegen/CompilerContext.h +++ b/libsolidity/codegen/CompilerContext.h @@ -71,7 +71,11 @@ public: void addStateVariable(VariableDeclaration const& _declaration, u256 const& _storageOffset, unsigned _byteOffset); void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0); - void removeVariable(VariableDeclaration const& _declaration); + void removeVariable(Declaration const& _declaration); + /// Removes all local variables currently allocated above _stackHeight. + void removeVariablesAboveStackHeight(unsigned _stackHeight); + /// Returns the number of currently allocated local variables. + unsigned numberOfLocalVariables() const; void setCompiledContracts(std::map<ContractDefinition const*, eth::Assembly const*> const& _contracts) { m_compiledContracts = _contracts; } eth::Assembly const& compiledContract(ContractDefinition const& _contract) const; |