aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerContext.h')
-rw-r--r--CompilerContext.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/CompilerContext.h b/CompilerContext.h
index 6a48e148..7272a368 100644
--- a/CompilerContext.h
+++ b/CompilerContext.h
@@ -43,8 +43,8 @@ public:
void addMagicGlobal(MagicVariableDeclaration const& _declaration);
void addStateVariable(VariableDeclaration const& _declaration);
void startNewFunction() { m_localVariables.clear(); m_asm.setDeposit(0); }
- void initializeLocalVariables(unsigned _numVariables);
- void addVariable(VariableDeclaration const& _declaration) { m_localVariables.push_back(&_declaration); }
+ void addVariable(VariableDeclaration const& _declaration);
+ void addAndInitializeVariable(VariableDeclaration const& _declaration);
void addFunction(FunctionDefinition const& _function) { m_functionEntryLabels.insert(std::make_pair(&_function, m_asm.newTag())); }
void adjustStackOffset(int _adjustment) { m_asm.adjustDeposit(_adjustment); }
@@ -98,8 +98,10 @@ private:
u256 m_stateVariablesSize;
/// Storage offsets of state variables
std::map<Declaration const*, u256> m_stateVariables;
- /// Offsets of local variables on the stack.
- std::vector<Declaration const*> m_localVariables;
+ /// Offsets of local variables on the stack (relative to stack base).
+ std::map<Declaration const*, unsigned> m_localVariables;
+ /// Sum of stack sizes of local variables
+ unsigned m_localVariablesSize;
/// Labels pointing to the entry points of funcitons.
std::map<Declaration const*, eth::AssemblyItem> m_functionEntryLabels;
};