Skip to content

Commit 4caca7a

Browse files
committed
[Clang] [NFC] Rename isAnyPointerType()
1 parent e3cd88a commit 4caca7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+162
-163
lines changed

clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static bool isVarThatIsPossiblyChanged(const Decl *Func, const Stmt *LoopStmt,
9393
if (T.isVolatileQualified())
9494
return true;
9595

96-
if (!T->isAnyPointerType() && !T->isReferenceType())
96+
if (!T->isPointerOrObjCObjectPointerType() && !T->isReferenceType())
9797
break;
9898

9999
T = T->getPointeeType();

clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void InitVariablesCheck::check(const MatchFinder::MatchResult &Result) {
9595
else if (TypePtr->isFloatingType()) {
9696
InitializationString = " = NAN";
9797
AddMathInclude = true;
98-
} else if (TypePtr->isAnyPointerType()) {
98+
} else if (TypePtr->isPointerOrObjCObjectPointerType()) {
9999
if (getLangOpts().CPlusPlus11)
100100
InitializationString = " = nullptr";
101101
else

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ StyleKind IdentifierNamingCheck::findStyleKind(
12181218
return SK_ConstexprVariable;
12191219

12201220
if (!Type.isNull() && Type.isConstQualified()) {
1221-
if (Type.getTypePtr()->isAnyPointerType() &&
1221+
if (Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
12221222
NamingStyles[SK_ConstantPointerParameter])
12231223
return SK_ConstantPointerParameter;
12241224

@@ -1232,7 +1232,7 @@ StyleKind IdentifierNamingCheck::findStyleKind(
12321232
if (Decl->isParameterPack() && NamingStyles[SK_ParameterPack])
12331233
return SK_ParameterPack;
12341234

1235-
if (!Type.isNull() && Type.getTypePtr()->isAnyPointerType() &&
1235+
if (!Type.isNull() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
12361236
NamingStyles[SK_PointerParameter])
12371237
return SK_PointerParameter;
12381238

@@ -1508,7 +1508,7 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15081508
if (Var->isStaticDataMember() && NamingStyles[SK_ClassConstant])
15091509
return SK_ClassConstant;
15101510

1511-
if (Var->isFileVarDecl() && Type.getTypePtr()->isAnyPointerType() &&
1511+
if (Var->isFileVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15121512
NamingStyles[SK_GlobalConstantPointer])
15131513
return SK_GlobalConstantPointer;
15141514

@@ -1518,7 +1518,7 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15181518
if (Var->isStaticLocal() && NamingStyles[SK_StaticConstant])
15191519
return SK_StaticConstant;
15201520

1521-
if (Var->isLocalVarDecl() && Type.getTypePtr()->isAnyPointerType() &&
1521+
if (Var->isLocalVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15221522
NamingStyles[SK_LocalConstantPointer])
15231523
return SK_LocalConstantPointer;
15241524

@@ -1535,7 +1535,7 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15351535
if (Var->isStaticDataMember() && NamingStyles[SK_ClassMember])
15361536
return SK_ClassMember;
15371537

1538-
if (Var->isFileVarDecl() && Type.getTypePtr()->isAnyPointerType() &&
1538+
if (Var->isFileVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15391539
NamingStyles[SK_GlobalPointer])
15401540
return SK_GlobalPointer;
15411541

@@ -1545,7 +1545,7 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15451545
if (Var->isStaticLocal() && NamingStyles[SK_StaticVariable])
15461546
return SK_StaticVariable;
15471547

1548-
if (Var->isLocalVarDecl() && Type.getTypePtr()->isAnyPointerType() &&
1548+
if (Var->isLocalVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15491549
NamingStyles[SK_LocalPointer])
15501550
return SK_LocalPointer;
15511551

clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static bool areTypesCompatible(QualType ArgType, QualType ParamType,
472472

473473
// Unless argument and param are both multilevel pointers, the types are not
474474
// convertible.
475-
if (!(ParamType->isAnyPointerType() && ArgType->isAnyPointerType()))
475+
if (!(ParamType->isPointerOrObjCObjectPointerType() && ArgType->isPointerOrObjCObjectPointerType()))
476476
return false;
477477

478478
return arePointerTypesCompatible(ArgType, ParamType, IsParamContinuouslyConst,

clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ inline bool isPointerOrPointerToMember(const Type *T) {
8484
}
8585

8686
std::optional<QualType> getPointeeOrArrayElementQualType(QualType T) {
87-
if (T->isAnyPointerType() || T->isMemberPointerType())
87+
if (T->isPointerOrObjCObjectPointerType() || T->isMemberPointerType())
8888
return T->getPointeeType();
8989

9090
if (T->isArrayType())

clang/include/clang/AST/CanonicalType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class CanProxyBase {
286286
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isDerivedType)
287287
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isScalarType)
288288
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isAggregateType)
289-
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isAnyPointerType)
289+
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isPointerOrObjCObjectPointerType)
290290
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVoidPointerType)
291291
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isFunctionPointerType)
292292
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isMemberFunctionPointerType)

clang/include/clang/AST/Type.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
25362536
bool isPointerType() const;
25372537
bool isPointerOrReferenceType() const;
25382538
bool isSignableType() const;
2539-
bool isAnyPointerType() const; // Any C pointer or ObjC object pointer
2539+
bool isPointerOrObjCObjectPointerType() const; // Any C pointer or ObjC object pointer
25402540
bool isCountAttributedType() const;
25412541
bool isBlockPointerType() const;
25422542
bool isVoidPointerType() const;
@@ -8196,7 +8196,7 @@ inline bool Type::isPointerOrReferenceType() const {
81968196
return isPointerType() || isReferenceType();
81978197
}
81988198

8199-
inline bool Type::isAnyPointerType() const {
8199+
inline bool Type::isPointerOrObjCObjectPointerType() const {
82008200
return isPointerType() || isObjCObjectPointerType();
82018201
}
82028202

@@ -8656,7 +8656,7 @@ inline bool Type::isUndeducedType() const {
86568656
inline bool Type::isOverloadableType() const {
86578657
if (!isDependentType())
86588658
return isRecordType() || isEnumeralType();
8659-
return !isArrayType() && !isFunctionType() && !isAnyPointerType() &&
8659+
return !isArrayType() && !isFunctionType() && !isPointerOrObjCObjectPointerType() &&
86608660
!isMemberPointerType();
86618661
}
86628662

@@ -8692,7 +8692,7 @@ inline const Type *Type::getBaseElementTypeUnsafe() const {
86928692

86938693
inline const Type *Type::getPointeeOrArrayElementType() const {
86948694
const Type *type = this;
8695-
if (type->isAnyPointerType())
8695+
if (type->isPointerOrObjCObjectPointerType())
86968696
return type->getPointeeType().getTypePtr();
86978697
else if (type->isArrayType())
86988698
return type->getBaseElementTypeUnsafe();

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,7 +4156,7 @@ AST_MATCHER_P(QualType, asString, std::string, Name) {
41564156
AST_MATCHER_P(
41574157
QualType, pointsTo, internal::Matcher<QualType>,
41584158
InnerMatcher) {
4159-
return (!Node.isNull() && Node->isAnyPointerType() &&
4159+
return (!Node.isNull() && Node->isPointerOrObjCObjectPointerType() &&
41604160
InnerMatcher.matches(Node->getPointeeType(), Finder, Builder));
41614161
}
41624162

@@ -6605,7 +6605,7 @@ AST_MATCHER(QualType, isAnyCharacter) {
66056605
/// varDecl(hasType(isAnyPointer()))
66066606
/// matches "int *i" and "Foo *f", but not "int j".
66076607
AST_MATCHER(QualType, isAnyPointer) {
6608-
return Node->isAnyPointerType();
6608+
return Node->isPointerOrObjCObjectPointerType();
66096609
}
66106610

66116611
/// Matches QualType nodes that are const-qualified, i.e., that

clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ class SymbolicRegion : public SubRegion {
787787
// Because pointer arithmetic is represented by ElementRegion layers,
788788
// the base symbol here should not contain any arithmetic.
789789
assert(isa_and_nonnull<SymbolData>(s));
790-
assert(s->getType()->isAnyPointerType() ||
790+
assert(s->getType()->isPointerOrObjCObjectPointerType() ||
791791
s->getType()->isReferenceType() ||
792792
s->getType()->isBlockPointerType());
793793
assert(isa<UnknownSpaceRegion>(sreg) || isa<HeapSpaceRegion>(sreg) ||

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class SMTConv {
264264
uint64_t FromBitWidth) {
265265
if ((FromTy->isIntegralOrEnumerationType() &&
266266
ToTy->isIntegralOrEnumerationType()) ||
267-
(FromTy->isAnyPointerType() ^ ToTy->isAnyPointerType()) ||
267+
(FromTy->isPointerOrObjCObjectPointerType() ^ ToTy->isPointerOrObjCObjectPointerType()) ||
268268
(FromTy->isBlockPointerType() ^ ToTy->isBlockPointerType()) ||
269269
(FromTy->isReferenceType() ^ ToTy->isReferenceType())) {
270270

@@ -365,7 +365,7 @@ class SMTConv {
365365

366366
// If the two operands are pointers and the operation is a subtraction,
367367
// the result is of type ptrdiff_t, which is signed
368-
if (LTy->isAnyPointerType() && RTy->isAnyPointerType() && Op == BO_Sub) {
368+
if (LTy->isPointerOrObjCObjectPointerType() && RTy->isPointerOrObjCObjectPointerType() && Op == BO_Sub) {
369369
*RetTy = Ctx.getPointerDiffType();
370370
}
371371
}
@@ -509,7 +509,7 @@ class SMTConv {
509509
Solver->mkFloat(Zero));
510510
}
511511

512-
if (Ty->isIntegralOrEnumerationType() || Ty->isAnyPointerType() ||
512+
if (Ty->isIntegralOrEnumerationType() || Ty->isPointerOrObjCObjectPointerType() ||
513513
Ty->isBlockPointerType() || Ty->isReferenceType()) {
514514

515515
// Skip explicit comparison for boolean types
@@ -613,7 +613,7 @@ class SMTConv {
613613
return;
614614
}
615615

616-
if ((LTy->isAnyPointerType() || RTy->isAnyPointerType()) ||
616+
if ((LTy->isPointerOrObjCObjectPointerType() || RTy->isPointerOrObjCObjectPointerType()) ||
617617
(LTy->isBlockPointerType() || RTy->isBlockPointerType()) ||
618618
(LTy->isReferenceType() || RTy->isReferenceType())) {
619619
// TODO: Refactor to Sema::FindCompositePointerType(), and
@@ -624,7 +624,7 @@ class SMTConv {
624624

625625
// Cast the non-pointer type to the pointer type.
626626
// TODO: Be more strict about this.
627-
if ((LTy->isAnyPointerType() ^ RTy->isAnyPointerType()) ||
627+
if ((LTy->isPointerOrObjCObjectPointerType() ^ RTy->isPointerOrObjCObjectPointerType()) ||
628628
(LTy->isBlockPointerType() ^ RTy->isBlockPointerType()) ||
629629
(LTy->isReferenceType() ^ RTy->isReferenceType())) {
630630
if (LTy->isNullPtrType() || LTy->isBlockPointerType() ||

0 commit comments

Comments
 (0)