Remove unused magic global feature.

This commit is contained in:
chriseth 2017-08-10 17:54:08 +02:00 committed by Alex Beregszaszi
parent 38446a9669
commit ee6f56d641
2 changed files with 2 additions and 10 deletions

View File

@ -44,11 +44,6 @@ namespace dev
namespace solidity namespace solidity
{ {
void CompilerContext::addMagicGlobal(MagicVariableDeclaration const& _declaration)
{
m_magicGlobals.insert(&_declaration);
}
void CompilerContext::addStateVariable( void CompilerContext::addStateVariable(
VariableDeclaration const& _declaration, VariableDeclaration const& _declaration,
u256 const& _storageOffset, u256 const& _storageOffset,

View File

@ -48,7 +48,7 @@ namespace solidity {
class CompilerContext class CompilerContext
{ {
public: public:
CompilerContext(CompilerContext* _runtimeContext = nullptr): explicit CompilerContext(CompilerContext* _runtimeContext = nullptr):
m_asm(std::make_shared<eth::Assembly>()), m_asm(std::make_shared<eth::Assembly>()),
m_runtimeContext(_runtimeContext) m_runtimeContext(_runtimeContext)
{ {
@ -56,7 +56,7 @@ public:
m_runtimeSub = size_t(m_asm->newSub(m_runtimeContext->m_asm).data()); m_runtimeSub = size_t(m_asm->newSub(m_runtimeContext->m_asm).data());
} }
void addMagicGlobal(MagicVariableDeclaration const& _declaration);
void addStateVariable(VariableDeclaration const& _declaration, u256 const& _storageOffset, unsigned _byteOffset); void addStateVariable(VariableDeclaration const& _declaration, u256 const& _storageOffset, unsigned _byteOffset);
void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0); void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0);
void removeVariable(VariableDeclaration const& _declaration); void removeVariable(VariableDeclaration const& _declaration);
@ -68,7 +68,6 @@ public:
void adjustStackOffset(int _adjustment) { m_asm->adjustDeposit(_adjustment); } void adjustStackOffset(int _adjustment) { m_asm->adjustDeposit(_adjustment); }
unsigned stackHeight() const { solAssert(m_asm->deposit() >= 0, ""); return unsigned(m_asm->deposit()); } 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 isLocalVariable(Declaration const* _declaration) const;
bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; } bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; }
@ -265,8 +264,6 @@ private:
} m_functionCompilationQueue; } m_functionCompilationQueue;
eth::AssemblyPointer m_asm; eth::AssemblyPointer m_asm;
/// Magic global variables like msg, tx or this, distinguished by type.
std::set<Declaration const*> m_magicGlobals;
/// Other already compiled contracts to be used in contract creation calls. /// Other already compiled contracts to be used in contract creation calls.
std::map<ContractDefinition const*, eth::Assembly const*> m_compiledContracts; std::map<ContractDefinition const*, eth::Assembly const*> m_compiledContracts;
/// Storage offsets of state variables /// Storage offsets of state variables