diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-05-15 15:15:02 -0400 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-05-23 14:42:06 +0200 |
commit | 558f62ec71a43c5fac7838f698edd95a26ff892d (patch) | |
tree | 87abd12d2ed84eb588c47e808ec228d0c142497b /src/libs/3rdparty/cplusplus/Symbols.cpp | |
parent | 194591da98e90f7452bc3b583e35892baba67a9f (diff) |
C++: Fix some Matcher::match() functions
...before using Matcher instead of {Type,Name}::isEqualTo().
Change-Id: Iba1c04064799fe9c81fe997dbd54fc02b15cdec7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Symbols.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Symbols.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbols.cpp b/src/libs/3rdparty/cplusplus/Symbols.cpp index f8b990139f..24647f2214 100644 --- a/src/libs/3rdparty/cplusplus/Symbols.cpp +++ b/src/libs/3rdparty/cplusplus/Symbols.cpp @@ -222,7 +222,7 @@ int Function::methodKey() const void Function::setMethodKey(int key) { f._methodKey = key; } -bool Function::isSignatureEqualTo(const Function *other) const +bool Function::isSignatureEqualTo(const Function *other, Matcher *matcher) const { if (! other) return false; @@ -230,22 +230,19 @@ bool Function::isSignatureEqualTo(const Function *other) const return false; else if (isVolatile() != other->isVolatile()) return false; + else if (! Matcher::match(unqualifiedName(), other->unqualifiedName(), matcher)) + return false; - const Name *l = unqualifiedName(); - const Name *r = other->unqualifiedName(); - if (l == r || (l && l->isEqualTo(r))) { - const unsigned argc = argumentCount(); - if (argc != other->argumentCount()) + const unsigned argc = argumentCount(); + if (argc != other->argumentCount()) + return false; + for (unsigned i = 0; i < argc; ++i) { + Symbol *l = argumentAt(i); + Symbol *r = other->argumentAt(i); + if (! l->type().match(r->type(), matcher)) return false; - for (unsigned i = 0; i < argc; ++i) { - Symbol *l = argumentAt(i); - Symbol *r = other->argumentAt(i); - if (! l->type().isEqualTo(r->type())) - return false; - } - return true; } - return false; + return true; } bool Function::isEqualTo(const Type *other) const |