diff options
author | chriseth <chris@ethereum.org> | 2017-08-14 23:04:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 23:04:00 +0800 |
commit | 2411f5d839cd784ef31e076812787b2e1934ca9f (patch) | |
tree | 1118f62a4a984c2ef81e418b3e57a44753155d6a /libsolidity/codegen/CompilerContext.h | |
parent | 0a04a35a2e02437ae038af41c947b3e829946bca (diff) | |
parent | 63b556b2063acfe84f16973bd5b0429d70f7fb93 (diff) | |
download | dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar.gz dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar.bz2 dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar.lz dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar.xz dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.tar.zst dexon-solidity-2411f5d839cd784ef31e076812787b2e1934ca9f.zip |
Merge pull request #2704 from ethereum/newEncoder
New ABI encoder
Diffstat (limited to 'libsolidity/codegen/CompilerContext.h')
-rw-r--r-- | libsolidity/codegen/CompilerContext.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h index 13821f67..583360ea 100644 --- a/libsolidity/codegen/CompilerContext.h +++ b/libsolidity/codegen/CompilerContext.h @@ -48,7 +48,7 @@ namespace solidity { class CompilerContext { public: - CompilerContext(CompilerContext* _runtimeContext = nullptr): + explicit CompilerContext(CompilerContext* _runtimeContext = nullptr): m_asm(std::make_shared<eth::Assembly>()), m_runtimeContext(_runtimeContext) { @@ -56,7 +56,9 @@ public: m_runtimeSub = size_t(m_asm->newSub(m_runtimeContext->m_asm).data()); } - void addMagicGlobal(MagicVariableDeclaration const& _declaration); + void setExperimentalFeatures(std::set<ExperimentalFeature> const& _features) { m_experimentalFeatures = _features; } + bool experimentalFeatureActive(ExperimentalFeature _feature) const { return m_experimentalFeatures.count(_feature); } + void addStateVariable(VariableDeclaration const& _declaration, u256 const& _storageOffset, unsigned _byteOffset); void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0); void removeVariable(VariableDeclaration const& _declaration); @@ -68,7 +70,6 @@ public: void adjustStackOffset(int _adjustment) { m_asm->adjustDeposit(_adjustment); } unsigned stackHeight() const { solAssert(m_asm->deposit() >= 0, ""); return unsigned(m_asm->deposit()); } - bool isMagicGlobal(Declaration const* _declaration) const { return m_magicGlobals.count(_declaration) != 0; } bool isLocalVariable(Declaration const* _declaration) const; bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; } @@ -265,8 +266,8 @@ private: } m_functionCompilationQueue; eth::AssemblyPointer m_asm; - /// Magic global variables like msg, tx or this, distinguished by type. - std::set<Declaration const*> m_magicGlobals; + /// Activated experimental features. + std::set<ExperimentalFeature> m_experimentalFeatures; /// Other already compiled contracts to be used in contract creation calls. std::map<ContractDefinition const*, eth::Assembly const*> m_compiledContracts; /// Storage offsets of state variables |