CPlusPlus: Inline more simple Type related functions

Change-Id: I2103e8047b385b438e58072e8a2689f1889d2724
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-06-24 16:45:12 +02:00
parent 27d51e9804
commit e2bb204d4d
26 changed files with 180 additions and 469 deletions

View File

@@ -283,10 +283,10 @@ bool Function::isSignatureEqualTo(const Function *other, Matcher *matcher) const
Symbol *l = argumentAt(i);
Symbol *r = other->argumentAt(i);
if (! l->type().match(r->type(), matcher)) {
if (!l->type()->isReferenceType() && !l->type()->isPointerType()
&& !l->type()->isPointerToMemberType()
&& !r->type()->isReferenceType() && !r->type()->isPointerType()
&& !r->type()->isPointerToMemberType()) {
if (!l->type()->asReferenceType() && !l->type()->asPointerType()
&& !l->type()->asPointerToMemberType()
&& !r->type()->asReferenceType() && !r->type()->asPointerType()
&& !r->type()->asPointerToMemberType()) {
FullySpecifiedType lType = l->type();
FullySpecifiedType rType = r->type();
lType.setConst(false);
@@ -333,7 +333,7 @@ bool Function::hasReturnType() const
int Function::argumentCount() const
{
const int memCnt = memberCount();
if (memCnt > 0 && memberAt(0)->type()->isVoidType())
if (memCnt > 0 && memberAt(0)->type()->asVoidType())
return 0;
// Definitions with function-try-blocks will have more than a block, and
@@ -362,7 +362,7 @@ Symbol *Function::argumentAt(int index) const
bool Function::hasArguments() const
{
int argc = argumentCount();
return ! (argc == 0 || (argc == 1 && argumentAt(0)->type()->isVoidType()));
return ! (argc == 0 || (argc == 1 && argumentAt(0)->type()->asVoidType()));
}
int Function::minimumArgumentCount() const
@@ -904,7 +904,7 @@ Symbol *ObjCMethod::argumentAt(int index) const
bool ObjCMethod::hasArguments() const
{
return ! (argumentCount() == 0 ||
(argumentCount() == 1 && argumentAt(0)->type()->isVoidType()));
(argumentCount() == 1 && argumentAt(0)->type()->asVoidType()));
}
void ObjCMethod::visitSymbol0(SymbolVisitor *visitor)