Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c26eb3

Browse filesBrowse files
committed
clang-format
1 parent 4caca7a commit 1c26eb3
Copy full SHA for 1c26eb3

28 files changed

+138
-87
lines changed

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

Copy file name to clipboardExpand all lines: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+10-5Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,8 @@ StyleKind IdentifierNamingCheck::findStyleKind(
12321232
if (Decl->isParameterPack() && NamingStyles[SK_ParameterPack])
12331233
return SK_ParameterPack;
12341234

1235-
if (!Type.isNull() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
1235+
if (!Type.isNull() &&
1236+
Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
12361237
NamingStyles[SK_PointerParameter])
12371238
return SK_PointerParameter;
12381239

@@ -1508,7 +1509,8 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15081509
if (Var->isStaticDataMember() && NamingStyles[SK_ClassConstant])
15091510
return SK_ClassConstant;
15101511

1511-
if (Var->isFileVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
1512+
if (Var->isFileVarDecl() &&
1513+
Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15121514
NamingStyles[SK_GlobalConstantPointer])
15131515
return SK_GlobalConstantPointer;
15141516

@@ -1518,7 +1520,8 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15181520
if (Var->isStaticLocal() && NamingStyles[SK_StaticConstant])
15191521
return SK_StaticConstant;
15201522

1521-
if (Var->isLocalVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
1523+
if (Var->isLocalVarDecl() &&
1524+
Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15221525
NamingStyles[SK_LocalConstantPointer])
15231526
return SK_LocalConstantPointer;
15241527

@@ -1535,7 +1538,8 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15351538
if (Var->isStaticDataMember() && NamingStyles[SK_ClassMember])
15361539
return SK_ClassMember;
15371540

1538-
if (Var->isFileVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
1541+
if (Var->isFileVarDecl() &&
1542+
Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15391543
NamingStyles[SK_GlobalPointer])
15401544
return SK_GlobalPointer;
15411545

@@ -1545,7 +1549,8 @@ StyleKind IdentifierNamingCheck::findStyleKindForVar(
15451549
if (Var->isStaticLocal() && NamingStyles[SK_StaticVariable])
15461550
return SK_StaticVariable;
15471551

1548-
if (Var->isLocalVarDecl() && Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
1552+
if (Var->isLocalVarDecl() &&
1553+
Type.getTypePtr()->isPointerOrObjCObjectPointerType() &&
15491554
NamingStyles[SK_LocalPointer])
15501555
return SK_LocalPointer;
15511556

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

Copy file name to clipboardExpand all lines: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ 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->isPointerOrObjCObjectPointerType() && ArgType->isPointerOrObjCObjectPointerType()))
475+
if (!(ParamType->isPointerOrObjCObjectPointerType() &&
476+
ArgType->isPointerOrObjCObjectPointerType()))
476477
return false;
477478

478479
return arePointerTypesCompatible(ArgType, ParamType, IsParamContinuouslyConst,

‎clang/include/clang/AST/Type.h

Copy file name to clipboardExpand all lines: clang/include/clang/AST/Type.h
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,8 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
25362536
bool isPointerType() const;
25372537
bool isPointerOrReferenceType() const;
25382538
bool isSignableType() const;
2539-
bool isPointerOrObjCObjectPointerType() const; // Any C pointer or ObjC object pointer
2539+
bool isPointerOrObjCObjectPointerType()
2540+
const; // Any C pointer or ObjC object pointer
25402541
bool isCountAttributedType() const;
25412542
bool isBlockPointerType() const;
25422543
bool isVoidPointerType() const;
@@ -8656,8 +8657,8 @@ inline bool Type::isUndeducedType() const {
86568657
inline bool Type::isOverloadableType() const {
86578658
if (!isDependentType())
86588659
return isRecordType() || isEnumeralType();
8659-
return !isArrayType() && !isFunctionType() && !isPointerOrObjCObjectPointerType() &&
8660-
!isMemberPointerType();
8660+
return !isArrayType() && !isFunctionType() &&
8661+
!isPointerOrObjCObjectPointerType() && !isMemberPointerType();
86618662
}
86628663

86638664
/// Determines whether this type is written as a typedef-name.

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

Copy file name to clipboardExpand all lines: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ class SMTConv {
264264
uint64_t FromBitWidth) {
265265
if ((FromTy->isIntegralOrEnumerationType() &&
266266
ToTy->isIntegralOrEnumerationType()) ||
267-
(FromTy->isPointerOrObjCObjectPointerType() ^ ToTy->isPointerOrObjCObjectPointerType()) ||
267+
(FromTy->isPointerOrObjCObjectPointerType() ^
268+
ToTy->isPointerOrObjCObjectPointerType()) ||
268269
(FromTy->isBlockPointerType() ^ ToTy->isBlockPointerType()) ||
269270
(FromTy->isReferenceType() ^ ToTy->isReferenceType())) {
270271

@@ -365,7 +366,8 @@ class SMTConv {
365366

366367
// If the two operands are pointers and the operation is a subtraction,
367368
// the result is of type ptrdiff_t, which is signed
368-
if (LTy->isPointerOrObjCObjectPointerType() && RTy->isPointerOrObjCObjectPointerType() && Op == BO_Sub) {
369+
if (LTy->isPointerOrObjCObjectPointerType() &&
370+
RTy->isPointerOrObjCObjectPointerType() && Op == BO_Sub) {
369371
*RetTy = Ctx.getPointerDiffType();
370372
}
371373
}
@@ -509,8 +511,9 @@ class SMTConv {
509511
Solver->mkFloat(Zero));
510512
}
511513

512-
if (Ty->isIntegralOrEnumerationType() || Ty->isPointerOrObjCObjectPointerType() ||
513-
Ty->isBlockPointerType() || Ty->isReferenceType()) {
514+
if (Ty->isIntegralOrEnumerationType() ||
515+
Ty->isPointerOrObjCObjectPointerType() || Ty->isBlockPointerType() ||
516+
Ty->isReferenceType()) {
514517

515518
// Skip explicit comparison for boolean types
516519
bool isSigned = Ty->isSignedIntegerOrEnumerationType();
@@ -613,7 +616,8 @@ class SMTConv {
613616
return;
614617
}
615618

616-
if ((LTy->isPointerOrObjCObjectPointerType() || RTy->isPointerOrObjCObjectPointerType()) ||
619+
if ((LTy->isPointerOrObjCObjectPointerType() ||
620+
RTy->isPointerOrObjCObjectPointerType()) ||
617621
(LTy->isBlockPointerType() || RTy->isBlockPointerType()) ||
618622
(LTy->isReferenceType() || RTy->isReferenceType())) {
619623
// TODO: Refactor to Sema::FindCompositePointerType(), and
@@ -624,7 +628,8 @@ class SMTConv {
624628

625629
// Cast the non-pointer type to the pointer type.
626630
// TODO: Be more strict about this.
627-
if ((LTy->isPointerOrObjCObjectPointerType() ^ RTy->isPointerOrObjCObjectPointerType()) ||
631+
if ((LTy->isPointerOrObjCObjectPointerType() ^
632+
RTy->isPointerOrObjCObjectPointerType()) ||
628633
(LTy->isBlockPointerType() ^ RTy->isBlockPointerType()) ||
629634
(LTy->isReferenceType() ^ RTy->isReferenceType())) {
630635
if (LTy->isNullPtrType() || LTy->isBlockPointerType() ||

‎clang/lib/AST/ASTContext.cpp

Copy file name to clipboardExpand all lines: clang/lib/AST/ASTContext.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,8 +2981,8 @@ bool ASTContext::isSentinelNullExpr(const Expr *E) {
29812981
if (E->getType()->isNullPtrType()) return true;
29822982

29832983
if (E->getType()->isPointerOrObjCObjectPointerType() &&
2984-
E->IgnoreParenCasts()->isNullPointerConstant(*this,
2985-
Expr::NPC_ValueDependentIsNull))
2984+
E->IgnoreParenCasts()->isNullPointerConstant(
2985+
*this, Expr::NPC_ValueDependentIsNull))
29862986
return true;
29872987

29882988
// Unfortunately, __null has type 'int'.

‎clang/lib/AST/MicrosoftMangle.cpp

Copy file name to clipboardExpand all lines: clang/lib/AST/MicrosoftMangle.cpp
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,8 +2570,9 @@ void MicrosoftCXXNameMangler::mangleType(QualType T, SourceRange Range,
25702570
return;
25712571
}
25722572

2573-
bool IsPointer = T->isPointerOrObjCObjectPointerType() || T->isMemberPointerType() ||
2574-
T->isReferenceType() || T->isBlockPointerType();
2573+
bool IsPointer = T->isPointerOrObjCObjectPointerType() ||
2574+
T->isMemberPointerType() || T->isReferenceType() ||
2575+
T->isBlockPointerType();
25752576

25762577
switch (QMM) {
25772578
case QMM_Drop:

‎clang/lib/Analysis/UninitializedValues.cpp

Copy file name to clipboardExpand all lines: clang/lib/Analysis/UninitializedValues.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ void ClassifyRefs::VisitOMPExecutableDirective(OMPExecutableDirective *ED) {
417417
}
418418

419419
static bool isPointerToConst(const QualType &QT) {
420-
return QT->isPointerOrObjCObjectPointerType() && QT->getPointeeType().isConstQualified();
420+
return QT->isPointerOrObjCObjectPointerType() &&
421+
QT->getPointeeType().isConstQualified();
421422
}
422423

423424
static bool hasTrivialBody(CallExpr *CE) {

‎clang/lib/CodeGen/CGCall.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CGCall.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,8 @@ static const NonNullAttr *getNonNullAttr(const Decl *FD, const ParmVarDecl *PVD,
29292929
// In the former case, LLVM IR cannot represent the constraint. In
29302930
// the latter case, we have no guarantee that the transparent union
29312931
// is in fact passed as a pointer.
2932-
if (!ArgType->isPointerOrObjCObjectPointerType() && !ArgType->isBlockPointerType())
2932+
if (!ArgType->isPointerOrObjCObjectPointerType() &&
2933+
!ArgType->isBlockPointerType())
29332934
return nullptr;
29342935
// First, check attribute on parameter itself.
29352936
if (PVD) {

‎clang/lib/CodeGen/CGOpenMPRuntime.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CGOpenMPRuntime.cpp
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7188,12 +7188,13 @@ class MappableExprsHandler {
71887188
dyn_cast<OMPArrayShapingExpr>(I->getAssociatedExpression());
71897189
const auto *UO = dyn_cast<UnaryOperator>(I->getAssociatedExpression());
71907190
const auto *BO = dyn_cast<BinaryOperator>(I->getAssociatedExpression());
7191-
bool IsPointer =
7192-
OAShE ||
7193-
(OASE && ArraySectionExpr::getBaseOriginalType(OASE)
7194-
.getCanonicalType()
7195-
->isPointerOrObjCObjectPointerType()) ||
7196-
I->getAssociatedExpression()->getType()->isPointerOrObjCObjectPointerType();
7191+
bool IsPointer = OAShE ||
7192+
(OASE && ArraySectionExpr::getBaseOriginalType(OASE)
7193+
.getCanonicalType()
7194+
->isPointerOrObjCObjectPointerType()) ||
7195+
I->getAssociatedExpression()
7196+
->getType()
7197+
->isPointerOrObjCObjectPointerType();
71977198
bool IsMemberReference = isa<MemberExpr>(I->getAssociatedExpression()) &&
71987199
MapDecl &&
71997200
MapDecl->getType()->isLValueReferenceType();
@@ -8533,7 +8534,8 @@ class MappableExprsHandler {
85338534
assert(VDecl == VD && "We got information for the wrong declaration??");
85348535
assert(!Components.empty() &&
85358536
"Not expecting declaration with no component lists.");
8536-
if (VD && E && VD->getType()->isPointerOrObjCObjectPointerType() && isa<DeclRefExpr>(E))
8537+
if (VD && E && VD->getType()->isPointerOrObjCObjectPointerType() &&
8538+
isa<DeclRefExpr>(E))
85378539
HasMapBasePtr = true;
85388540
if (VD && E && VD->getType()->isPointerOrObjCObjectPointerType() &&
85398541
(isa<ArraySectionExpr>(E) || isa<ArraySubscriptExpr>(E)))
@@ -8784,7 +8786,8 @@ class MappableExprsHandler {
87848786
CombinedInfo.BasePointers.push_back(CV);
87858787
CombinedInfo.DevicePtrDecls.push_back(nullptr);
87868788
CombinedInfo.DevicePointers.push_back(DeviceInfoTy::None);
8787-
if (I != FirstPrivateDecls.end() && ElementType->isPointerOrObjCObjectPointerType()) {
8789+
if (I != FirstPrivateDecls.end() &&
8790+
ElementType->isPointerOrObjCObjectPointerType()) {
87888791
Address PtrAddr = CGF.EmitLoadOfReference(CGF.MakeAddrLValue(
87898792
CV, ElementType, CGF.getContext().getDeclAlign(VD),
87908793
AlignmentSource::Decl));

‎clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,9 @@ llvm::Function *CGOpenMPRuntimeGPU::createParallelDataSharingWrapper(
19621962
CGFContext.getPointerType(ElemTy),
19631963
CI->getLocation());
19641964
if (CI->capturesVariableByCopy() &&
1965-
!CI->getCapturedVar()->getType()->isPointerOrObjCObjectPointerType()) {
1965+
!CI->getCapturedVar()
1966+
->getType()
1967+
->isPointerOrObjCObjectPointerType()) {
19661968
Arg = castValueToType(CGF, Arg, ElemTy, CGFContext.getUIntPtrType(),
19671969
CI->getLocation());
19681970
}

‎clang/lib/CodeGen/CGStmtOpenMP.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CGStmtOpenMP.cpp
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ static llvm::Function *emitOutlinedFunctionPrologue(
520520
// deal with pointers. We can pass in the same way the VLA type sizes to the
521521
// outlined function.
522522
if (FO.UIntPtrCastRequired &&
523-
((I->capturesVariableByCopy() && !ArgType->isPointerOrObjCObjectPointerType()) ||
523+
((I->capturesVariableByCopy() &&
524+
!ArgType->isPointerOrObjCObjectPointerType()) ||
524525
I->capturesVariableArrayType()))
525526
ArgType = Ctx.getUIntPtrType();
526527

@@ -601,7 +602,8 @@ static llvm::Function *emitOutlinedFunctionPrologue(
601602
}
602603
// If we are capturing a pointer by copy we don't need to do anything, just
603604
// use the value that we get from the arguments.
604-
if (I->capturesVariableByCopy() && FD->getType()->isPointerOrObjCObjectPointerType()) {
605+
if (I->capturesVariableByCopy() &&
606+
FD->getType()->isPointerOrObjCObjectPointerType()) {
605607
const VarDecl *CurVD = I->getCapturedVar();
606608
if (!FO.RegisterCastedArgsOnly)
607609
LocalAddrs.insert({Args[Cnt], {CurVD, LocalAddr}});

‎clang/lib/CodeGen/CodeGenTypes.cpp

Copy file name to clipboardExpand all lines: clang/lib/CodeGen/CodeGenTypes.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ CodeGenTypes::getCGRecordLayout(const RecordDecl *RD) {
832832
}
833833

834834
bool CodeGenTypes::isPointerZeroInitializable(QualType T) {
835-
assert((T->isPointerOrObjCObjectPointerType() || T->isBlockPointerType()) && "Invalid type");
835+
assert((T->isPointerOrObjCObjectPointerType() || T->isBlockPointerType()) &&
836+
"Invalid type");
836837
return isZeroInitializable(T);
837838
}
838839

‎clang/lib/Frontend/ASTUnit.cpp

Copy file name to clipboardExpand all lines: clang/lib/Frontend/ASTUnit.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,9 +2135,9 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
21352135
CodeCompletionString *Completion = C->Completion;
21362136
if (!Context.getPreferredType().isNull()) {
21372137
if (C->Kind == CXCursor_MacroDefinition) {
2138-
Priority = getMacroUsagePriority(C->Completion->getTypedText(),
2139-
S.getLangOpts(),
2140-
Context.getPreferredType()->isPointerOrObjCObjectPointerType());
2138+
Priority = getMacroUsagePriority(
2139+
C->Completion->getTypedText(), S.getLangOpts(),
2140+
Context.getPreferredType()->isPointerOrObjCObjectPointerType());
21412141
} else if (C->Type) {
21422142
CanQualType Expected
21432143
= S.Context.getCanonicalType(

‎clang/lib/Sema/SemaAPINotes.cpp

Copy file name to clipboardExpand all lines: clang/lib/Sema/SemaAPINotes.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static bool isIndirectPointerType(QualType Type) {
4848
if (Pointee.isNull())
4949
return false;
5050

51-
return Pointee->isPointerOrObjCObjectPointerType() || Pointee->isObjCObjectPointerType() ||
52-
Pointee->isMemberPointerType();
51+
return Pointee->isPointerOrObjCObjectPointerType() ||
52+
Pointee->isObjCObjectPointerType() || Pointee->isMemberPointerType();
5353
}
5454

5555
/// Apply nullability to the given declaration.

‎clang/lib/Sema/SemaARM.cpp

Copy file name to clipboardExpand all lines: clang/lib/Sema/SemaARM.cpp
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ bool SemaARM::BuiltinARMMemoryTaggingCall(unsigned BuiltinID,
162162
}
163163

164164
// at least one argument should be pointer type
165-
if (!ArgTypeA->isPointerOrObjCObjectPointerType() && !ArgTypeB->isPointerOrObjCObjectPointerType())
165+
if (!ArgTypeA->isPointerOrObjCObjectPointerType() &&
166+
!ArgTypeB->isPointerOrObjCObjectPointerType())
166167
return Diag(TheCall->getBeginLoc(), diag::err_memtag_any2arg_pointer)
167168
<< ArgTypeA << ArgTypeB << ArgA->getSourceRange();
168169

@@ -924,7 +925,8 @@ bool SemaARM::CheckARMBuiltinExclusiveCall(unsigned BuiltinID,
924925
TheCall->setArg(IsLdrex ? 0 : 1, PointerArg);
925926

926927
// In general, we allow ints, floats and pointers to be loaded and stored.
927-
if (!ValType->isIntegerType() && !ValType->isPointerOrObjCObjectPointerType() &&
928+
if (!ValType->isIntegerType() &&
929+
!ValType->isPointerOrObjCObjectPointerType() &&
928930
!ValType->isBlockPointerType() && !ValType->isFloatingType()) {
929931
Diag(DRE->getBeginLoc(), diag::err_atomic_builtin_must_be_pointer_intfltptr)
930932
<< PointerArg->getType() << 0 << PointerArg->getSourceRange();

‎clang/lib/Sema/SemaCast.cpp

Copy file name to clipboardExpand all lines: clang/lib/Sema/SemaCast.cpp
+19-12Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,16 @@ static CastAwayConstnessKind
596596
unwrapCastAwayConstnessLevel(ASTContext &Context, QualType &T1, QualType &T2) {
597597
enum { None, Ptr, MemPtr, BlockPtr, Array };
598598
auto Classify = [](QualType T) {
599-
if (T->isPointerOrObjCObjectPointerType()) return Ptr;
600-
if (T->isMemberPointerType()) return MemPtr;
601-
if (T->isBlockPointerType()) return BlockPtr;
599+
if (T->isPointerOrObjCObjectPointerType())
600+
return Ptr;
601+
if (T->isMemberPointerType())
602+
return MemPtr;
603+
if (T->isBlockPointerType())
604+
return BlockPtr;
602605
// We somewhat-arbitrarily don't look through VLA types here. This is at
603606
// least consistent with the behavior of UnwrapSimilarTypes.
604-
if (T->isConstantArrayType() || T->isIncompleteArrayType()) return Array;
607+
if (T->isConstantArrayType() || T->isIncompleteArrayType())
608+
return Array;
605609
return None;
606610
};
607611

@@ -682,10 +686,11 @@ CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
682686
return CastAwayConstnessKind::CACK_None;
683687

684688
if (!DestType->isReferenceType()) {
685-
assert((SrcType->isPointerOrObjCObjectPointerType() || SrcType->isMemberPointerType() ||
686-
SrcType->isBlockPointerType()) &&
689+
assert((SrcType->isPointerOrObjCObjectPointerType() ||
690+
SrcType->isMemberPointerType() || SrcType->isBlockPointerType()) &&
687691
"Source type is not pointer or pointer to member.");
688-
assert((DestType->isPointerOrObjCObjectPointerType() || DestType->isMemberPointerType() ||
692+
assert((DestType->isPointerOrObjCObjectPointerType() ||
693+
DestType->isMemberPointerType() ||
689694
DestType->isBlockPointerType()) &&
690695
"Destination type is not pointer or pointer to member.");
691696
}
@@ -2451,8 +2456,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
24512456
TryCastResult Result = TC_NotApplicable;
24522457
if (SrcType->isIntegralOrEnumerationType() ||
24532458
SrcType->isPointerOrObjCObjectPointerType() ||
2454-
SrcType->isMemberPointerType() ||
2455-
SrcType->isBlockPointerType()) {
2459+
SrcType->isMemberPointerType() || SrcType->isBlockPointerType()) {
24562460
Result = TC_Success;
24572461
}
24582462
return Result;
@@ -2902,8 +2906,10 @@ static void DiagnoseBadFunctionCast(Sema &Self, const ExprResult &SrcExpr,
29022906
QualType SrcType = SrcExpr.get()->getType();
29032907
if (DestType.getUnqualifiedType()->isVoidType())
29042908
return;
2905-
if ((SrcType->isPointerOrObjCObjectPointerType() || SrcType->isBlockPointerType())
2906-
&& (DestType->isPointerOrObjCObjectPointerType() || DestType->isBlockPointerType()))
2909+
if ((SrcType->isPointerOrObjCObjectPointerType() ||
2910+
SrcType->isBlockPointerType()) &&
2911+
(DestType->isPointerOrObjCObjectPointerType() ||
2912+
DestType->isBlockPointerType()))
29072913
return;
29082914
if (SrcType->isIntegerType() && DestType->isIntegerType() &&
29092915
(SrcType->isBooleanType() == DestType->isBooleanType()) &&
@@ -3318,7 +3324,8 @@ static void DiagnoseCastQual(Sema &Self, const ExprResult &SrcExpr,
33183324
return;
33193325

33203326
QualType SrcType = SrcExpr.get()->getType();
3321-
if (!((SrcType->isPointerOrObjCObjectPointerType() && DestType->isPointerOrObjCObjectPointerType()) ||
3327+
if (!((SrcType->isPointerOrObjCObjectPointerType() &&
3328+
DestType->isPointerOrObjCObjectPointerType()) ||
33223329
DestType->isLValueReferenceType()))
33233330
return;
33243331

‎clang/lib/Sema/SemaChecking.cpp

Copy file name to clipboardExpand all lines: clang/lib/Sema/SemaChecking.cpp
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,7 +4281,8 @@ ExprResult Sema::BuiltinAtomicOverloaded(ExprResult TheCallResult) {
42814281
}
42824282

42834283
QualType ValType = pointerType->getPointeeType();
4284-
if (!ValType->isIntegerType() && !ValType->isPointerOrObjCObjectPointerType() &&
4284+
if (!ValType->isIntegerType() &&
4285+
!ValType->isPointerOrObjCObjectPointerType() &&
42854286
!ValType->isBlockPointerType()) {
42864287
Diag(DRE->getBeginLoc(), diag::err_atomic_builtin_must_be_pointer_intptr)
42874288
<< FirstArg->getType() << 0 << FirstArg->getSourceRange();
@@ -4658,7 +4659,8 @@ ExprResult Sema::BuiltinNontemporalOverloaded(ExprResult TheCallResult) {
46584659

46594660
// Strip any qualifiers off ValType.
46604661
ValType = ValType.getUnqualifiedType();
4661-
if (!ValType->isIntegerType() && !ValType->isPointerOrObjCObjectPointerType() &&
4662+
if (!ValType->isIntegerType() &&
4663+
!ValType->isPointerOrObjCObjectPointerType() &&
46624664
!ValType->isBlockPointerType() && !ValType->isFloatingType() &&
46634665
!ValType->isVectorType()) {
46644666
Diag(DRE->getBeginLoc(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.