aboutsummaryrefslogtreecommitdiffstats
path: root/DeclarationContainer.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-05-07 16:12:27 +0800
committerLiana Husikyan <liana@ethdev.com>2015-05-08 23:51:52 +0800
commit115c22c0e001fd0f9c440c45b33009bfe99697f8 (patch)
treec014363b1b8491a16f65b0a6c2a22cab4a8dc884 /DeclarationContainer.cpp
parent4fdfbaa3674a1597d1f192075700ac5951772193 (diff)
downloaddexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar.gz
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar.bz2
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar.lz
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar.xz
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.tar.zst
dexon-solidity-115c22c0e001fd0f9c440c45b33009bfe99697f8.zip
changed the way of resolving declarations. now the cleanup of function duplications in libsolidity/NameAndTypeResolver.cpp(WIP)
Diffstat (limited to 'DeclarationContainer.cpp')
-rw-r--r--DeclarationContainer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/DeclarationContainer.cpp b/DeclarationContainer.cpp
index c836663c..ec8a59bb 100644
--- a/DeclarationContainer.cpp
+++ b/DeclarationContainer.cpp
@@ -37,6 +37,7 @@ Declaration const* DeclarationContainer::conflictingDeclaration(Declaration cons
declarations += m_declarations.at(name);
if (m_invisibleDeclarations.count(name))
declarations += m_invisibleDeclarations.at(name);
+
if (dynamic_cast<FunctionDefinition const*>(&_declaration))
{
// check that all other declarations with the same name are functions
@@ -66,14 +67,13 @@ bool DeclarationContainer::registerDeclaration(Declaration const& _declaration,
return false;
if (_invisible)
- m_invisibleDeclarations[name].insert(&_declaration);
+ m_invisibleDeclarations[name].push_back(&_declaration);
else
- m_declarations[name].insert(&_declaration);
-
+ m_declarations[name].push_back(&_declaration);
return true;
}
-set<Declaration const*> DeclarationContainer::resolveName(ASTString const& _name, bool _recursive) const
+std::vector<const Declaration *> DeclarationContainer::resolveName(ASTString const& _name, bool _recursive) const
{
solAssert(!_name.empty(), "Attempt to resolve empty name.");
auto result = m_declarations.find(_name);
@@ -81,5 +81,5 @@ set<Declaration const*> DeclarationContainer::resolveName(ASTString const& _name
return result->second;
if (_recursive && m_enclosingContainer)
return m_enclosingContainer->resolveName(_name, true);
- return set<Declaration const*>({});
+ return vector<Declaration const*>({});
}