Browse Source

removed unused member

added some comments for ModifierInvocation::checkTypeRequirements
cleanup
cl-refactor
Liana Husikyan 10 years ago
parent
commit
a545b8a7a4
  1. 8
      libsolidity/AST.cpp
  2. 2
      libsolidity/AST.h
  3. 2
      libsolidity/CompilerContext.cpp

8
libsolidity/AST.cpp

@ -353,7 +353,7 @@ void ModifierDefinition::checkTypeRequirements()
m_body->checkTypeRequirements();
}
void ModifierInvocation::checkTypeRequirements(std::vector<ASTPointer<InheritanceSpecifier>> const& _bases)
void ModifierInvocation::checkTypeRequirements(vector<ASTPointer<InheritanceSpecifier>> const& _bases)
{
m_modifierName->checkTypeRequirements();
for (ASTPointer<Expression> const& argument: m_arguments)
@ -365,12 +365,12 @@ void ModifierInvocation::checkTypeRequirements(std::vector<ASTPointer<Inheritanc
if (auto modifier = dynamic_cast<ModifierDefinition const*>(declaration))
parameters = &modifier->getParameters();
else
// check parameters for Base constructors
for (auto const& base: _bases)
if (declaration == base->getName()->getReferencedDeclaration())
{
m_referencedConstructor = dynamic_cast<ContractDefinition const&>(*declaration).getConstructor();
if (m_referencedConstructor)
parameters = &m_referencedConstructor->getParameters();
if (auto referencedConstructor = dynamic_cast<ContractDefinition const&>(*declaration).getConstructor())
parameters = &referencedConstructor->getParameters();
else
parameters = &emptyParameterList;
break;

2
libsolidity/AST.h

@ -525,12 +525,12 @@ public:
ASTPointer<Identifier> const& getName() const { return m_modifierName; }
std::vector<ASTPointer<Expression>> const& getArguments() const { return m_arguments; }
/// @param _bases is the list of base contracts for base constructor calls. For modifiers an empty vector should be passed.
void checkTypeRequirements(std::vector<ASTPointer<InheritanceSpecifier>> const& _bases);
private:
ASTPointer<Identifier> m_modifierName;
std::vector<ASTPointer<Expression>> m_arguments;
FunctionDefinition const* m_referencedConstructor = nullptr;
};
/**

2
libsolidity/CompilerContext.cpp

@ -126,7 +126,7 @@ eth::AssemblyItem CompilerContext::getSuperFunctionEntryLabel(string const& _nam
FunctionDefinition const* CompilerContext::getNextConstructor(ContractDefinition const& _contract) const
{
vector<ContractDefinition const*>::const_iterator it = getSuperContract(_contract);
for (; it != m_inheritanceHierarchy.end(); it = getSuperContract(**it))
for (; it != m_inheritanceHierarchy.end(); ++it)
if ((*it)->getConstructor())
return (*it)->getConstructor();

Loading…
Cancel
Save