aboutsummaryrefslogtreecommitdiffstats
path: root/overloaddata.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-20 15:14:19 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-23 11:46:58 -0300
commit68dab51ea3e835b6739385a9e415e0093f397392 (patch)
tree425b542c139a594503de74959096adc4bb843714 /overloaddata.cpp
parentc476a59f4f8709723bceaa1973251ee0c3032ecc (diff)
Renamed OverloadData::hasDefaultValue to OverloadData::getFunctionWithDefaultValue
and modified it to return a pointer to the actual AbstractMetaFunction with the default value (or NULL if it doesn't has the value), instead of just returning a boolean. The overload decisor writer makes use of this new behavior to get the correct function for a method call with default values.
Diffstat (limited to 'overloaddata.cpp')
-rw-r--r--overloaddata.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/overloaddata.cpp b/overloaddata.cpp
index 6190674d0..f73592952 100644
--- a/overloaddata.cpp
+++ b/overloaddata.cpp
@@ -244,7 +244,7 @@ OverloadDataList OverloadData::overloadDataOnPosition(int argPos) const
bool OverloadData::nextArgumentHasDefaultValue() const
{
foreach (OverloadData* overloadData, m_nextOverloadData) {
- if (overloadData->hasDefaultValue())
+ if (overloadData->getFunctionWithDefaultValue())
return true;
}
return false;
@@ -252,7 +252,7 @@ bool OverloadData::nextArgumentHasDefaultValue() const
static OverloadData* _findNextArgWithDefault(OverloadData* overloadData)
{
- if (overloadData->hasDefaultValue())
+ if (overloadData->getFunctionWithDefaultValue())
return overloadData;
OverloadData* result = 0;
@@ -278,7 +278,7 @@ bool OverloadData::isFinalOccurrence(const AbstractMetaFunction* func) const
return true;
}
-bool OverloadData::hasDefaultValue() const
+const AbstractMetaFunction* OverloadData::getFunctionWithDefaultValue() const
{
foreach (const AbstractMetaFunction* func, m_overloads) {
int removedArgs = 0;
@@ -287,9 +287,9 @@ bool OverloadData::hasDefaultValue() const
removedArgs++;
}
if (!func->arguments()[m_argPos + removedArgs]->defaultValueExpression().isEmpty())
- return true;
+ return func;
}
- return false;
+ return 0;
}
QList<int> OverloadData::invalidArgumentLengths() const