Skip to content

Commit 0984fd9

Browse files
committed
run clang format
Signed-off-by: Justin Stitt <[email protected]>
1 parent 96edd91 commit 0984fd9

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

@@ -2615,7 +2614,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26152614
bool isSubscriptableVectorType() const;
26162615
bool isMatrixType() const; // Matrix type.
26172616
bool isConstantMatrixType() const; // Constant matrix type.
2618-
bool isOverflowBehaviorType() const; // __attribute__((no_sanitize))
2617+
bool isOverflowBehaviorType() const; // __attribute__((no_sanitize))
26192618
bool isDependentAddressSpaceType() const; // value-dependent address space qualifier
26202619
bool isObjCObjectPointerType() const; // pointer to ObjC object
26212620
bool isObjCRetainableType() const; // ObjC object or block pointer
@@ -6324,20 +6323,18 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode {
63246323

63256324
class OverflowBehaviorType : public Type, public llvm::FoldingSetNode {
63266325
public:
6327-
enum OverflowBehaviorKind {
6328-
Wrap,
6329-
NoWrap
6330-
};
6326+
enum OverflowBehaviorKind { Wrap, NoWrap };
63316327

63326328
private:
63336329
friend class ASTContext; // ASTContext creates these
63346330

63356331
QualType UnderlyingType;
63366332
OverflowBehaviorKind BehaviorKind;
63376333

6338-
OverflowBehaviorType(QualType Canon, QualType Underlying, OverflowBehaviorKind Kind);
6339-
public:
6334+
OverflowBehaviorType(QualType Canon, QualType Underlying,
6335+
OverflowBehaviorKind Kind);
63406336

6337+
public:
63416338
QualType getUnderlyingType() const { return UnderlyingType; }
63426339
OverflowBehaviorKind getBehaviorKind() const { return BehaviorKind; }
63436340

@@ -8895,8 +8892,7 @@ inline bool Type::isScalarType() const {
88958892
isa<MemberPointerType>(CanonicalType) ||
88968893
isa<ComplexType>(CanonicalType) ||
88978894
isa<ObjCObjectPointerType>(CanonicalType) ||
8898-
isa<OverflowBehaviorType>(CanonicalType) ||
8899-
isBitIntType();
8895+
isa<OverflowBehaviorType>(CanonicalType) || isBitIntType();
89008896
}
89018897

89028898
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
@@ -3780,8 +3780,8 @@ ASTContext::adjustType(QualType Orig,
37803780

37813781
case Type::OverflowBehavior: {
37823782
const auto *OB = dyn_cast<OverflowBehaviorType>(Orig);
3783-
return getOverflowBehaviorType(
3784-
OB->getBehaviorKind(), adjustType(OB->getUnderlyingType(), Adjust));
3783+
return getOverflowBehaviorType(OB->getBehaviorKind(),
3784+
adjustType(OB->getUnderlyingType(), Adjust));
37853785
}
37863786

37873787
case Type::Elaborated: {
@@ -5595,8 +5595,8 @@ QualType ASTContext::getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr,
55955595
return QualType(Ty, 0);
55965596
}
55975597

5598-
QualType
5599-
ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, QualType Underlying) const {
5598+
QualType ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr,
5599+
QualType Underlying) const {
56005600
IdentifierInfo *II = Attr->getBehaviorKind();
56015601
StringRef IdentName = II->getName();
56025602
OverflowBehaviorType::OverflowBehaviorKind Kind;
@@ -5611,8 +5611,9 @@ ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, QualType U
56115611
return getOverflowBehaviorType(Kind, Underlying);
56125612
}
56135613

5614-
QualType
5615-
ASTContext::getOverflowBehaviorType(OverflowBehaviorType::OverflowBehaviorKind Kind, QualType Underlying) const {
5614+
QualType ASTContext::getOverflowBehaviorType(
5615+
OverflowBehaviorType::OverflowBehaviorKind Kind,
5616+
QualType Underlying) const {
56165617
llvm::FoldingSetNodeID ID;
56175618
OverflowBehaviorType::Profile(ID, Underlying, Kind);
56185619
void *InsertPos = nullptr;
@@ -5625,13 +5626,14 @@ ASTContext::getOverflowBehaviorType(OverflowBehaviorType::OverflowBehaviorKind K
56255626
QualType Canonical;
56265627
if (!Underlying.isCanonical()) {
56275628
Canonical = getOverflowBehaviorType(Kind, getCanonicalType(Underlying));
5628-
OverflowBehaviorType *NewOBT = OverflowBehaviorTypes.FindNodeOrInsertPos(ID, InsertPos);
5629+
OverflowBehaviorType *NewOBT =
5630+
OverflowBehaviorTypes.FindNodeOrInsertPos(ID, InsertPos);
56295631
assert(!NewOBT && "Shouldn't be in the map!");
56305632
(void)NewOBT;
56315633
}
56325634

56335635
OverflowBehaviorType *Ty = new (*this, alignof(OverflowBehaviorType))
5634-
OverflowBehaviorType(Canonical, Underlying, Kind);
5636+
OverflowBehaviorType(Canonical, Underlying, Kind);
56355637

56365638
Types.push_back(Ty);
56375639
OverflowBehaviorTypes.InsertNode(Ty, InsertPos);
@@ -11725,9 +11727,9 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer,
1172511727
if (LHSRefTy || RHSRefTy)
1172611728
return {};
1172711729

11728-
if (std::optional<QualType> MergedOBT = tryMergeOverflowBehaviorTypes(
11729-
LHS, RHS, OfBlockPointer, Unqualified, BlockReturnType,
11730-
IsConditionalOperator))
11730+
if (std::optional<QualType> MergedOBT =
11731+
tryMergeOverflowBehaviorTypes(LHS, RHS, OfBlockPointer, Unqualified,
11732+
BlockReturnType, IsConditionalOperator))
1173111733
return *MergedOBT;
1173211734

1173311735
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
@@ -2136,23 +2136,23 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T,
21362136
printAfter(T->getWrappedType(), OS);
21372137
}
21382138

2139-
void TypePrinter::printOverflowBehaviorBefore(
2140-
const OverflowBehaviorType *T, raw_ostream &OS) {
2139+
void TypePrinter::printOverflowBehaviorBefore(const OverflowBehaviorType *T,
2140+
raw_ostream &OS) {
21412141
StringRef KindName;
21422142
switch (T->getBehaviorKind()) {
2143-
case clang::OverflowBehaviorType::OverflowBehaviorKind::Wrap:
2144-
KindName = "__wrap";
2145-
break;
2146-
case clang::OverflowBehaviorType::OverflowBehaviorKind::NoWrap:
2147-
KindName = "__no_wrap";
2148-
break;
2143+
case clang::OverflowBehaviorType::OverflowBehaviorKind::Wrap:
2144+
KindName = "__wrap";
2145+
break;
2146+
case clang::OverflowBehaviorType::OverflowBehaviorKind::NoWrap:
2147+
KindName = "__no_wrap";
2148+
break;
21492149
}
21502150
OS << KindName << " ";
21512151
printBefore(T->getUnderlyingType(), OS);
21522152
}
21532153

2154-
void TypePrinter::printOverflowBehaviorAfter(
2155-
const OverflowBehaviorType *T, raw_ostream &OS) {
2154+
void TypePrinter::printOverflowBehaviorAfter(const OverflowBehaviorType *T,
2155+
raw_ostream &OS) {
21562156
printAfter(T->getUnderlyingType(), OS);
21572157
}
21582158

clang/lib/CodeGen/CGDebugInfo.cpp

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

1129-
llvm::DIType *CGDebugInfo::CreateType(const OverflowBehaviorType *Ty, llvm::DIFile *U) {
1129+
llvm::DIType *CGDebugInfo::CreateType(const OverflowBehaviorType *Ty,
1130+
llvm::DIFile *U) {
11301131
return getOrCreateType(Ty->getUnderlyingType(), U);
11311132
}
11321133

0 commit comments

Comments
 (0)