summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Symbols.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-08-16 11:13:20 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-08-16 11:13:20 +0200
commit833f097c1d9bd30d05b28f0f17bc4624e56d6e94 (patch)
tree652a907a8378ed0506f7ff7b082c14fe1476d013 /src/shared/cplusplus/Symbols.cpp
parent5cc32e107915d818ca4ceb8f08441d3ec72ed86b (diff)
downloadqt-creator-833f097c1d9bd30d05b28f0f17bc4624e56d6e94.tar.gz
Get rid of Function::block/setBlock.
Diffstat (limited to 'src/shared/cplusplus/Symbols.cpp')
-rw-r--r--src/shared/cplusplus/Symbols.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/shared/cplusplus/Symbols.cpp b/src/shared/cplusplus/Symbols.cpp
index a2259e715a..121ea0364e 100644
--- a/src/shared/cplusplus/Symbols.cpp
+++ b/src/shared/cplusplus/Symbols.cpp
@@ -164,7 +164,6 @@ void TypenameArgument::visitSymbol0(SymbolVisitor *visitor)
Function::Function(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
: Scope(translationUnit, sourceLocation, name),
- _block(0),
_flags(0)
{ }
@@ -189,12 +188,6 @@ int Function::methodKey() const
void Function::setMethodKey(int key)
{ f._methodKey = key; }
-Block *Function::block() const
-{ return _block; }
-
-void Function::setBlock(Block *block)
-{ _block = block; }
-
bool Function::isEqualTo(const Type *other) const
{
const Function *o = other->asFunctionType();
@@ -293,10 +286,10 @@ bool Function::hasReturnType() const
unsigned Function::argumentCount() const
{
- if (_block)
- return memberCount() - 1;
-
- return memberCount();
+ const unsigned c = memberCount();
+ if (c > 0 && memberAt(c - 1)->isBlock())
+ return c - 1;
+ return c;
}
Symbol *Function::argumentAt(unsigned index) const