Skip to content

Commit 11b6127

Browse files
committed
run clang format
Signed-off-by: Justin Stitt <[email protected]>
1 parent 79643df commit 11b6127

19 files changed

+97
-99
lines changed

clang/include/clang/AST/PropertiesBase.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def AutoTypeKeyword : EnumPropertyType;
8181
def Bool : PropertyType<"bool">;
8282
def BuiltinTypeKind : EnumPropertyType<"BuiltinType::Kind">;
8383
def BTFTypeTagAttr : PropertyType<"const BTFTypeTagAttr *">;
84-
def OverflowBehaviorKind : EnumPropertyType<"OverflowBehaviorType::OverflowBehaviorKind">;
84+
def OverflowBehaviorKind
85+
: EnumPropertyType<"OverflowBehaviorType::OverflowBehaviorKind">;
8586
def CallingConv : EnumPropertyType;
8687
def DeclarationName : PropertyType;
8788
def DeclarationNameKind : EnumPropertyType<"DeclarationName::NameKind">;

clang/include/clang/AST/Type.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ class QualType {
11491149
/// Returns true if it is a WebAssembly Funcref Type.
11501150
bool isWebAssemblyFuncrefType() const;
11511151

1152-
11531152
/// Returns true if it is a OverflowBehaviorType of Wrap kind.
11541153
bool isWrapType() const;
11551154

@@ -2640,7 +2639,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26402639
bool isSubscriptableVectorType() const;
26412640
bool isMatrixType() const; // Matrix type.
26422641
bool isConstantMatrixType() const; // Constant matrix type.
2643-
bool isOverflowBehaviorType() const; // __attribute__((no_sanitize))
2642+
bool isOverflowBehaviorType() const; // __attribute__((no_sanitize))
26442643
bool isDependentAddressSpaceType() const; // value-dependent address space qualifier
26452644
bool isObjCObjectPointerType() const; // pointer to ObjC object
26462645
bool isObjCRetainableType() const; // ObjC object or block pointer
@@ -6349,20 +6348,18 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode {
63496348

63506349
class OverflowBehaviorType : public Type, public llvm::FoldingSetNode {
63516350
public:
6352-
enum OverflowBehaviorKind {
6353-
Wrap,
6354-
NoWrap
6355-
};
6351+
enum OverflowBehaviorKind { Wrap, NoWrap };
63566352

63576353
private:
63586354
friend class ASTContext; // ASTContext creates these
63596355

63606356
QualType UnderlyingType;
63616357
OverflowBehaviorKind BehaviorKind;
63626358

6363-
OverflowBehaviorType(QualType Canon, QualType Underlying, OverflowBehaviorKind Kind);
6364-
public:
6359+
OverflowBehaviorType(QualType Canon, QualType Underlying,
6360+
OverflowBehaviorKind Kind);
63656361

6362+
public:
63666363
QualType getUnderlyingType() const { return UnderlyingType; }
63676364
OverflowBehaviorKind getBehaviorKind() const { return BehaviorKind; }
63686365

@@ -8951,8 +8948,7 @@ inline bool Type::isScalarType() const {
89518948
isa<MemberPointerType>(CanonicalType) ||
89528949
isa<ComplexType>(CanonicalType) ||
89538950
isa<ObjCObjectPointerType>(CanonicalType) ||
8954-
isa<OverflowBehaviorType>(CanonicalType) ||
8955-
isBitIntType();
8951+
isa<OverflowBehaviorType>(CanonicalType) || isBitIntType();
89568952
}
89578953

89588954
inline bool Type::isIntegralOrEnumerationType() const {

clang/include/clang/AST/TypeLoc.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,13 +946,14 @@ struct OverflowBehaviorLocInfo {}; // Nothing.
946946

947947
class OverflowBehaviorTypeLoc
948948
: public ConcreteTypeLoc<UnqualTypeLoc, OverflowBehaviorTypeLoc,
949-
OverflowBehaviorType,
950-
OverflowBehaviorLocInfo> {
949+
OverflowBehaviorType, OverflowBehaviorLocInfo> {
951950
public:
952951
TypeLoc getWrappedLoc() const { return getInnerTypeLoc(); }
953952

954953
/// The no_sanitize type attribute.
955-
OverflowBehaviorType::OverflowBehaviorKind getBehaviorKind() const { return getTypePtr()->getBehaviorKind(); }
954+
OverflowBehaviorType::OverflowBehaviorKind getBehaviorKind() const {
955+
return getTypePtr()->getBehaviorKind();
956+
}
956957

957958
SourceRange getLocalSourceRange() const;
958959

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ def ImplicitIntConversion : DiagGroup<"implicit-int-conversion",
121121
[Shorten64To32,
122122
ObjCSignedCharBoolImplicitIntConversion,
123123
ImplicitIntConversionOnNegation]>;
124-
def ImplicitlyDiscardedOverflowBehaviorPedantic :
125-
DiagGroup<"implicitly-discarded-overflow-behavior-pedantic">;
126-
def ImplicitlyDiscardedOverflowBehaviorAssignment :
127-
DiagGroup<"implicitly-discarded-overflow-behavior-assignment">;
128-
def ImplicitlyDiscardedOverflowBehavior :
129-
DiagGroup<"implicitly-discarded-overflow-behavior",
130-
[ImplicitlyDiscardedOverflowBehaviorPedantic,
131-
ImplicitlyDiscardedOverflowBehaviorAssignment]>;
124+
def ImplicitlyDiscardedOverflowBehaviorPedantic
125+
: DiagGroup<"implicitly-discarded-overflow-behavior-pedantic">;
126+
def ImplicitlyDiscardedOverflowBehaviorAssignment
127+
: DiagGroup<"implicitly-discarded-overflow-behavior-assignment">;
128+
def ImplicitlyDiscardedOverflowBehavior
129+
: DiagGroup<"implicitly-discarded-overflow-behavior",
130+
[ImplicitlyDiscardedOverflowBehaviorPedantic,
131+
ImplicitlyDiscardedOverflowBehaviorAssignment]>;
132132
def ImplicitConstIntFloatConversion : DiagGroup<"implicit-const-int-float-conversion">;
133133
def ImplicitIntFloatConversion : DiagGroup<"implicit-int-float-conversion",
134134
[ImplicitConstIntFloatConversion]>;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,9 +4031,10 @@ def note_cannot_use_trivial_abi_reason : Note<
40314031
"it has an address-discriminated '__ptrauth' field}1">;
40324032

40334033
// OverflowBehavior attribute
4034-
def err_overflow_behavior_unknown_ident : Error<
4035-
"'%0' is not a valid argument to attribute %1, only 'wrap' and 'no_wrap' "
4036-
"are supported">;
4034+
def err_overflow_behavior_unknown_ident
4035+
: Error<"'%0' is not a valid argument to attribute %1, only 'wrap' and "
4036+
"'no_wrap' "
4037+
"are supported">;
40374038
def warn_overflow_behavior_non_integer_type
40384039
: Warning<"%0 attribute cannot be applied to non-integer type '%1'; "
40394040
"attribute ignored">,
@@ -4042,15 +4043,17 @@ def warn_overflow_behavior_attribute_disabled
40424043
: Warning<"%0 attribute is ignored because it is not enabled; pass "
40434044
"-foverflow-behavior-types">,
40444045
InGroup<OverflowBehaviorAttributeIgnored>;
4045-
def warn_implicitly_discarded_overflow_behavior : Warning<
4046-
"implicit conversion from %0 to %1 discards overflow behavior">,
4047-
InGroup<ImplicitlyDiscardedOverflowBehavior>;
4048-
def warn_implicitly_discarded_overflow_behavior_pedantic : Warning<
4049-
"implicit conversion from %0 to %1 discards overflow behavior">,
4050-
InGroup<ImplicitlyDiscardedOverflowBehaviorPedantic>;
4051-
def warn_implicitly_discarded_overflow_behavior_assignment : Warning<
4052-
"implicit conversion from %0 to %1 during assignment discards overflow behavior">,
4053-
InGroup<ImplicitlyDiscardedOverflowBehaviorAssignment>, DefaultIgnore;
4046+
def warn_implicitly_discarded_overflow_behavior
4047+
: Warning<"implicit conversion from %0 to %1 discards overflow behavior">,
4048+
InGroup<ImplicitlyDiscardedOverflowBehavior>;
4049+
def warn_implicitly_discarded_overflow_behavior_pedantic
4050+
: Warning<"implicit conversion from %0 to %1 discards overflow behavior">,
4051+
InGroup<ImplicitlyDiscardedOverflowBehaviorPedantic>;
4052+
def warn_implicitly_discarded_overflow_behavior_assignment
4053+
: Warning<"implicit conversion from %0 to %1 during assignment discards "
4054+
"overflow behavior">,
4055+
InGroup<ImplicitlyDiscardedOverflowBehaviorAssignment>,
4056+
DefaultIgnore;
40544057
// Availability attribute
40554058
def warn_availability_unknown_platform : Warning<
40564059
"unknown platform %0 in availability macro">, InGroup<Availability>;

clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ class LangOptionsBase {
131131
OB_FWrapv
132132
};
133133

134-
135134
// FIXME: Unify with TUKind.
136135
enum CompilingModuleKind {
137136
/// Not compiling a module interface at all.

clang/lib/AST/ASTContext.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3783,8 +3783,8 @@ ASTContext::adjustType(QualType Orig,
37833783

37843784
case Type::OverflowBehavior: {
37853785
const auto *OB = dyn_cast<OverflowBehaviorType>(Orig);
3786-
return getOverflowBehaviorType(
3787-
OB->getBehaviorKind(), adjustType(OB->getUnderlyingType(), Adjust));
3786+
return getOverflowBehaviorType(OB->getBehaviorKind(),
3787+
adjustType(OB->getUnderlyingType(), Adjust));
37883788
}
37893789

37903790
case Type::Elaborated: {
@@ -5631,8 +5631,8 @@ QualType ASTContext::getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr,
56315631
return QualType(Ty, 0);
56325632
}
56335633

5634-
QualType
5635-
ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, QualType Underlying) const {
5634+
QualType ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr,
5635+
QualType Underlying) const {
56365636
IdentifierInfo *II = Attr->getBehaviorKind();
56375637
StringRef IdentName = II->getName();
56385638
OverflowBehaviorType::OverflowBehaviorKind Kind;
@@ -5647,8 +5647,9 @@ ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, QualType U
56475647
return getOverflowBehaviorType(Kind, Underlying);
56485648
}
56495649

5650-
QualType
5651-
ASTContext::getOverflowBehaviorType(OverflowBehaviorType::OverflowBehaviorKind Kind, QualType Underlying) const {
5650+
QualType ASTContext::getOverflowBehaviorType(
5651+
OverflowBehaviorType::OverflowBehaviorKind Kind,
5652+
QualType Underlying) const {
56525653
llvm::FoldingSetNodeID ID;
56535654
OverflowBehaviorType::Profile(ID, Underlying, Kind);
56545655
void *InsertPos = nullptr;
@@ -5661,13 +5662,14 @@ ASTContext::getOverflowBehaviorType(OverflowBehaviorType::OverflowBehaviorKind K
56615662
QualType Canonical;
56625663
if (!Underlying.isCanonical()) {
56635664
Canonical = getOverflowBehaviorType(Kind, getCanonicalType(Underlying));
5664-
OverflowBehaviorType *NewOBT = OverflowBehaviorTypes.FindNodeOrInsertPos(ID, InsertPos);
5665+
OverflowBehaviorType *NewOBT =
5666+
OverflowBehaviorTypes.FindNodeOrInsertPos(ID, InsertPos);
56655667
assert(!NewOBT && "Shouldn't be in the map!");
56665668
(void)NewOBT;
56675669
}
56685670

56695671
OverflowBehaviorType *Ty = new (*this, alignof(OverflowBehaviorType))
5670-
OverflowBehaviorType(Canonical, Underlying, Kind);
5672+
OverflowBehaviorType(Canonical, Underlying, Kind);
56715673

56725674
Types.push_back(Ty);
56735675
OverflowBehaviorTypes.InsertNode(Ty, InsertPos);
@@ -11747,9 +11749,9 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer,
1174711749
if (LHSRefTy || RHSRefTy)
1174811750
return {};
1174911751

11750-
if (std::optional<QualType> MergedOBT = tryMergeOverflowBehaviorTypes(
11751-
LHS, RHS, OfBlockPointer, Unqualified, BlockReturnType,
11752-
IsConditionalOperator))
11752+
if (std::optional<QualType> MergedOBT =
11753+
tryMergeOverflowBehaviorTypes(LHS, RHS, OfBlockPointer, Unqualified,
11754+
BlockReturnType, IsConditionalOperator))
1175311755
return *MergedOBT;
1175411756

1175511757
if (Unqualified) {

clang/lib/AST/Type.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,8 @@ struct SimpleTransformVisitor : public TypeVisitor<Derived, QualType> {
11641164
if (UnderlyingType.isNull())
11651165
return {};
11661166

1167-
if (UnderlyingType.getAsOpaquePtr() == T->getUnderlyingType().getAsOpaquePtr())
1167+
if (UnderlyingType.getAsOpaquePtr() ==
1168+
T->getUnderlyingType().getAsOpaquePtr())
11681169
return QualType(T, 0);
11691170

11701171
return Ctx.getOverflowBehaviorType(T->getBehaviorKind(), UnderlyingType);
@@ -2140,7 +2141,6 @@ bool Type::isIntegralType(const ASTContext &Ctx) const {
21402141
return OBT->getUnderlyingType()->isIntegralOrEnumerationType();
21412142
}
21422143

2143-
21442144
return isBitIntType();
21452145
}
21462146

clang/lib/AST/TypePrinter.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,23 +2146,23 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T,
21462146
printAfter(T->getWrappedType(), OS);
21472147
}
21482148

2149-
void TypePrinter::printOverflowBehaviorBefore(
2150-
const OverflowBehaviorType *T, raw_ostream &OS) {
2149+
void TypePrinter::printOverflowBehaviorBefore(const OverflowBehaviorType *T,
2150+
raw_ostream &OS) {
21512151
StringRef KindName;
21522152
switch (T->getBehaviorKind()) {
2153-
case clang::OverflowBehaviorType::OverflowBehaviorKind::Wrap:
2154-
KindName = "__wrap";
2155-
break;
2156-
case clang::OverflowBehaviorType::OverflowBehaviorKind::NoWrap:
2157-
KindName = "__no_wrap";
2158-
break;
2153+
case clang::OverflowBehaviorType::OverflowBehaviorKind::Wrap:
2154+
KindName = "__wrap";
2155+
break;
2156+
case clang::OverflowBehaviorType::OverflowBehaviorKind::NoWrap:
2157+
KindName = "__no_wrap";
2158+
break;
21592159
}
21602160
OS << KindName << " ";
21612161
printBefore(T->getUnderlyingType(), OS);
21622162
}
21632163

2164-
void TypePrinter::printOverflowBehaviorAfter(
2165-
const OverflowBehaviorType *T, raw_ostream &OS) {
2164+
void TypePrinter::printOverflowBehaviorAfter(const OverflowBehaviorType *T,
2165+
raw_ostream &OS) {
21662166
printAfter(T->getUnderlyingType(), OS);
21672167
}
21682168

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,8 @@ llvm::DIType *CGDebugInfo::CreateType(const BitIntType *Ty) {
11241124
Encoding);
11251125
}
11261126

1127-
llvm::DIType *CGDebugInfo::CreateType(const OverflowBehaviorType *Ty, llvm::DIFile *U) {
1127+
llvm::DIType *CGDebugInfo::CreateType(const OverflowBehaviorType *Ty,
1128+
llvm::DIFile *U) {
11281129
return getOrCreateType(Ty->getUnderlyingType(), U);
11291130
}
11301131

0 commit comments

Comments
 (0)