mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Solidity EntryLabel now uses a generic declaration
- Instead of a FunctionDefinition
This commit is contained in:
parent
3f5eb96584
commit
b95048768d
10
Compiler.cpp
10
Compiler.cpp
@ -43,9 +43,13 @@ void Compiler::compileContract(ContractDefinition const& _contract,
|
||||
|
||||
for (ContractDefinition const* contract: _contract.getLinearizedBaseContracts())
|
||||
{
|
||||
for (ASTPointer<FunctionDefinition> const& function: contract->getDefinedFunctions())
|
||||
if (!function->isConstructor())
|
||||
m_context.addFunction(*function);
|
||||
for (auto const& it: contract->getInterfaceFunctions())
|
||||
{
|
||||
auto funcDef = it.second.getFunctionDefinition();
|
||||
if (funcDef && funcDef->isConstructor())
|
||||
continue;
|
||||
m_context.addFunction(*it.second.getDeclaration());
|
||||
}
|
||||
for (ASTPointer<ModifierDefinition> const& modifier: contract->getFunctionModifiers())
|
||||
m_context.addModifier(*modifier);
|
||||
}
|
||||
|
@ -59,11 +59,11 @@ void CompilerContext::addAndInitializeVariable(VariableDeclaration const& _decla
|
||||
*this << u256(0);
|
||||
}
|
||||
|
||||
void CompilerContext::addFunction(FunctionDefinition const& _function)
|
||||
void CompilerContext::addFunction(Declaration const& _decl)
|
||||
{
|
||||
eth::AssemblyItem tag(m_asm.newTag());
|
||||
m_functionEntryLabels.insert(make_pair(&_function, tag));
|
||||
m_virtualFunctionEntryLabels.insert(make_pair(_function.getName(), tag));
|
||||
m_functionEntryLabels.insert(make_pair(&_decl, tag));
|
||||
m_virtualFunctionEntryLabels.insert(make_pair(_decl.getName(), tag));
|
||||
}
|
||||
|
||||
void CompilerContext::addModifier(ModifierDefinition const& _modifier)
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
void startNewFunction() { m_localVariables.clear(); m_asm.setDeposit(0); }
|
||||
void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0);
|
||||
void addAndInitializeVariable(VariableDeclaration const& _declaration);
|
||||
void addFunction(FunctionDefinition const& _function);
|
||||
void addFunction(Declaration const& _decl);
|
||||
/// Adds the given modifier to the list by name if the name is not present already.
|
||||
void addModifier(ModifierDefinition const& _modifier);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user