forked from qt-creator/qt-creator
Moved some complicated checks into convenience functions
This commit is contained in:
@@ -217,6 +217,12 @@ FullySpecifiedType Function::returnType() const
|
||||
void Function::setReturnType(FullySpecifiedType returnType)
|
||||
{ _returnType = returnType; }
|
||||
|
||||
bool Function::hasReturnType() const
|
||||
{
|
||||
const FullySpecifiedType ty = returnType();
|
||||
return ty.isValid() || ty.isSigned() || ty.isUnsigned();
|
||||
}
|
||||
|
||||
unsigned Function::argumentCount() const
|
||||
{
|
||||
if (! _arguments)
|
||||
@@ -231,6 +237,12 @@ Symbol *Function::argumentAt(unsigned index) const
|
||||
Scope *Function::arguments() const
|
||||
{ return _arguments; }
|
||||
|
||||
bool Function::hasArguments() const
|
||||
{
|
||||
return ! (argumentCount() == 0 ||
|
||||
(argumentCount() == 1 && argumentAt(0)->type()->isVoidType()));
|
||||
}
|
||||
|
||||
bool Function::isVariadic() const
|
||||
{ return _isVariadic; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user