Skip to content

Commit acddebe

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:fa6b57421537 into amd-gfx:35d1a83ccbd6
Local branch amd-gfx 35d1a83 Merged main:73498d260888 into amd-gfx:9c8159c3d483 Remote branch main fa6b574 [flang] Account for shadowed symbols when skimming executable part (llvm#70246)
2 parents 35d1a83 + fa6b574 commit acddebe

File tree

86 files changed

+2291
-1723
lines changed

Some content is hidden

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

86 files changed

+2291
-1723
lines changed

clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
5353
if (const auto Dep = TheType.getAs<DependentNameTypeLoc>()) {
5454
const IdentifierInfo *Identifier = Dep.getTypePtr()->getIdentifier();
5555
if (!Identifier || Identifier->getName() != "type" ||
56-
Dep.getTypePtr()->getKeyword() != ETK_Typename) {
56+
Dep.getTypePtr()->getKeyword() != ElaboratedTypeKeyword::Typename) {
5757
return std::nullopt;
5858
}
5959
TheType = Dep.getQualifierLoc().getTypeLoc();
@@ -105,7 +105,7 @@ matchEnableIfSpecializationImplTrait(TypeLoc TheType) {
105105
if (const auto *AliasedType =
106106
dyn_cast<DependentNameType>(Specialization->getAliasedType())) {
107107
if (AliasedType->getIdentifier()->getName() != "type" ||
108-
AliasedType->getKeyword() != ETK_Typename) {
108+
AliasedType->getKeyword() != ElaboratedTypeKeyword::Typename) {
109109
return std::nullopt;
110110
}
111111
} else {

clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ struct UnqualNameVisitor : public RecursiveASTVisitor<UnqualNameVisitor> {
9898
return false;
9999
const auto *T = TL.getTypePtr();
100100
return TraverseTypeLoc(TL.getNamedTypeLoc(),
101-
T->getKeyword() != ETK_None || T->getQualifier());
101+
T->getKeyword() != ElaboratedTypeKeyword::None ||
102+
T->getQualifier());
102103
}
103104

104105
bool VisitDeclRefExpr(DeclRefExpr *S) {

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def main():
257257
parser.add_argument(
258258
"-allow-enabling-alpha-checkers",
259259
action="store_true",
260-
help="allow alpha checkers from " "clang-analyzer.",
260+
help="allow alpha checkers from clang-analyzer.",
261261
)
262262
parser.add_argument(
263263
"-clang-tidy-binary", metavar="PATH", help="path to clang-tidy binary"
@@ -270,7 +270,7 @@ def main():
270270
parser.add_argument(
271271
"-checks",
272272
default=None,
273-
help="checks filter, when not specified, use clang-tidy " "default",
273+
help="checks filter, when not specified, use clang-tidy default",
274274
)
275275
config_group = parser.add_mutually_exclusive_group()
276276
config_group.add_argument(
@@ -303,7 +303,7 @@ def main():
303303
parser.add_argument(
304304
"-line-filter",
305305
default=None,
306-
help="List of files with line ranges to filter the" "warnings.",
306+
help="List of files with line ranges to filter the warnings.",
307307
)
308308
if yaml:
309309
parser.add_argument(
@@ -335,12 +335,12 @@ def main():
335335
)
336336
parser.add_argument("-fix", action="store_true", help="apply fix-its")
337337
parser.add_argument(
338-
"-format", action="store_true", help="Reformat code " "after applying fixes"
338+
"-format", action="store_true", help="Reformat code after applying fixes"
339339
)
340340
parser.add_argument(
341341
"-style",
342342
default="file",
343-
help="The style of reformat " "code after applying fixes",
343+
help="The style of reformat code after applying fixes",
344344
)
345345
parser.add_argument(
346346
"-use-color",
@@ -359,14 +359,14 @@ def main():
359359
dest="extra_arg",
360360
action="append",
361361
default=[],
362-
help="Additional argument to append to the compiler " "command line.",
362+
help="Additional argument to append to the compiler command line.",
363363
)
364364
parser.add_argument(
365365
"-extra-arg-before",
366366
dest="extra_arg_before",
367367
action="append",
368368
default=[],
369-
help="Additional argument to prepend to the compiler " "command line.",
369+
help="Additional argument to prepend to the compiler command line.",
370370
)
371371
parser.add_argument(
372372
"-quiet", action="store_true", help="Run clang-tidy in quiet mode"
@@ -381,7 +381,7 @@ def main():
381381
parser.add_argument(
382382
"-warnings-as-errors",
383383
default=None,
384-
help="Upgrades warnings to errors. Same format as " "'-checks'",
384+
help="Upgrades warnings to errors. Same format as '-checks'",
385385
)
386386
args = parser.parse_args()
387387

clang/include/clang/AST/ASTContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,12 +1493,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
14931493
///
14941494
/// \pre \p VectorType must be a built-in type.
14951495
QualType getVectorType(QualType VectorType, unsigned NumElts,
1496-
VectorType::VectorKind VecKind) const;
1496+
VectorKind VecKind) const;
14971497
/// Return the unique reference to the type for a dependently sized vector of
14981498
/// the specified element type.
14991499
QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr,
15001500
SourceLocation AttrLoc,
1501-
VectorType::VectorKind VecKind) const;
1501+
VectorKind VecKind) const;
15021502

15031503
/// Return the unique reference to an extended vector type
15041504
/// of the specified element type and size.

clang/include/clang/AST/PropertiesBase.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def TypeOfKind : EnumPropertyType<"TypeOfKind">;
142142
def UInt32 : CountPropertyType<"uint32_t">;
143143
def UInt64 : CountPropertyType<"uint64_t">;
144144
def UnaryTypeTransformKind : EnumPropertyType<"UnaryTransformType::UTTKind">;
145-
def VectorKind : EnumPropertyType<"VectorType::VectorKind">;
145+
def VectorKind : EnumPropertyType<"VectorKind">;
146146

147147
def ExceptionSpecInfo : PropertyType<"FunctionProtoType::ExceptionSpecInfo"> {
148148
let BufferElementTypes = [ QualType ];

clang/include/clang/AST/Type.h

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,61 @@ enum class AutoTypeKeyword {
15751575
/// 'static' is only allowed on function parameters.
15761576
enum class ArraySizeModifier { Normal, Static, Star };
15771577

1578+
/// The elaboration keyword that precedes a qualified type name or
1579+
/// introduces an elaborated-type-specifier.
1580+
enum class ElaboratedTypeKeyword {
1581+
/// The "struct" keyword introduces the elaborated-type-specifier.
1582+
Struct,
1583+
1584+
/// The "__interface" keyword introduces the elaborated-type-specifier.
1585+
Interface,
1586+
1587+
/// The "union" keyword introduces the elaborated-type-specifier.
1588+
Union,
1589+
1590+
/// The "class" keyword introduces the elaborated-type-specifier.
1591+
Class,
1592+
1593+
/// The "enum" keyword introduces the elaborated-type-specifier.
1594+
Enum,
1595+
1596+
/// The "typename" keyword precedes the qualified type name, e.g.,
1597+
/// \c typename T::type.
1598+
Typename,
1599+
1600+
/// No keyword precedes the qualified type name.
1601+
None
1602+
};
1603+
1604+
enum class VectorKind {
1605+
/// not a target-specific vector type
1606+
Generic,
1607+
1608+
/// is AltiVec vector
1609+
AltiVecVector,
1610+
1611+
/// is AltiVec 'vector Pixel'
1612+
AltiVecPixel,
1613+
1614+
/// is AltiVec 'vector bool ...'
1615+
AltiVecBool,
1616+
1617+
/// is ARM Neon vector
1618+
Neon,
1619+
1620+
/// is ARM Neon polynomial vector
1621+
NeonPoly,
1622+
1623+
/// is AArch64 SVE fixed-length data vector
1624+
SveFixedLengthData,
1625+
1626+
/// is AArch64 SVE fixed-length predicate vector
1627+
SveFixedLengthPredicate,
1628+
1629+
/// is RISC-V RVV fixed-length data vector
1630+
RVVFixedLengthData,
1631+
};
1632+
15781633
/// The base class of the type hierarchy.
15791634
///
15801635
/// A central concept with types is that each type always has a canonical
@@ -3426,36 +3481,6 @@ class DependentSizedExtVectorType : public Type, public llvm::FoldingSetNode {
34263481
/// Since the constructor takes the number of vector elements, the
34273482
/// client is responsible for converting the size into the number of elements.
34283483
class VectorType : public Type, public llvm::FoldingSetNode {
3429-
public:
3430-
enum VectorKind {
3431-
/// not a target-specific vector type
3432-
GenericVector,
3433-
3434-
/// is AltiVec vector
3435-
AltiVecVector,
3436-
3437-
/// is AltiVec 'vector Pixel'
3438-
AltiVecPixel,
3439-
3440-
/// is AltiVec 'vector bool ...'
3441-
AltiVecBool,
3442-
3443-
/// is ARM Neon vector
3444-
NeonVector,
3445-
3446-
/// is ARM Neon polynomial vector
3447-
NeonPolyVector,
3448-
3449-
/// is AArch64 SVE fixed-length data vector
3450-
SveFixedLengthDataVector,
3451-
3452-
/// is AArch64 SVE fixed-length predicate vector
3453-
SveFixedLengthPredicateVector,
3454-
3455-
/// is RISC-V RVV fixed-length data vector
3456-
RVVFixedLengthDataVector,
3457-
};
3458-
34593484
protected:
34603485
friend class ASTContext; // ASTContext creates these.
34613486

@@ -3490,7 +3515,7 @@ class VectorType : public Type, public llvm::FoldingSetNode {
34903515
ID.AddPointer(ElementType.getAsOpaquePtr());
34913516
ID.AddInteger(NumElements);
34923517
ID.AddInteger(TypeClass);
3493-
ID.AddInteger(VecKind);
3518+
ID.AddInteger(llvm::to_underlying(VecKind));
34943519
}
34953520

34963521
static bool classof(const Type *T) {
@@ -3515,14 +3540,14 @@ class DependentVectorType : public Type, public llvm::FoldingSetNode {
35153540
SourceLocation Loc;
35163541

35173542
DependentVectorType(QualType ElementType, QualType CanonType, Expr *SizeExpr,
3518-
SourceLocation Loc, VectorType::VectorKind vecKind);
3543+
SourceLocation Loc, VectorKind vecKind);
35193544

35203545
public:
35213546
Expr *getSizeExpr() const { return SizeExpr; }
35223547
QualType getElementType() const { return ElementType; }
35233548
SourceLocation getAttributeLoc() const { return Loc; }
3524-
VectorType::VectorKind getVectorKind() const {
3525-
return VectorType::VectorKind(VectorTypeBits.VecKind);
3549+
VectorKind getVectorKind() const {
3550+
return VectorKind(VectorTypeBits.VecKind);
35263551
}
35273552

35283553
bool isSugared() const { return false; }
@@ -3538,7 +3563,7 @@ class DependentVectorType : public Type, public llvm::FoldingSetNode {
35383563

35393564
static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
35403565
QualType ElementType, const Expr *SizeExpr,
3541-
VectorType::VectorKind VecKind);
3566+
VectorKind VecKind);
35423567
};
35433568

35443569
/// ExtVectorType - Extended vector type. This type is created using
@@ -3551,7 +3576,8 @@ class ExtVectorType : public VectorType {
35513576
friend class ASTContext; // ASTContext creates these.
35523577

35533578
ExtVectorType(QualType vecType, unsigned nElements, QualType canonType)
3554-
: VectorType(ExtVector, vecType, nElements, canonType, GenericVector) {}
3579+
: VectorType(ExtVector, vecType, nElements, canonType,
3580+
VectorKind::Generic) {}
35553581

35563582
public:
35573583
static int getPointAccessorIdx(char c) {
@@ -5659,32 +5685,6 @@ enum TagTypeKind {
56595685
TTK_Enum
56605686
};
56615687

5662-
/// The elaboration keyword that precedes a qualified type name or
5663-
/// introduces an elaborated-type-specifier.
5664-
enum ElaboratedTypeKeyword {
5665-
/// The "struct" keyword introduces the elaborated-type-specifier.
5666-
ETK_Struct,
5667-
5668-
/// The "__interface" keyword introduces the elaborated-type-specifier.
5669-
ETK_Interface,
5670-
5671-
/// The "union" keyword introduces the elaborated-type-specifier.
5672-
ETK_Union,
5673-
5674-
/// The "class" keyword introduces the elaborated-type-specifier.
5675-
ETK_Class,
5676-
5677-
/// The "enum" keyword introduces the elaborated-type-specifier.
5678-
ETK_Enum,
5679-
5680-
/// The "typename" keyword precedes the qualified type name, e.g.,
5681-
/// \c typename T::type.
5682-
ETK_Typename,
5683-
5684-
/// No keyword precedes the qualified type name.
5685-
ETK_None
5686-
};
5687-
56885688
/// A helper class for Type nodes having an ElaboratedTypeKeyword.
56895689
/// The keyword in stored in the free bits of the base class.
56905690
/// Also provides a few static helpers for converting and printing
@@ -5694,7 +5694,7 @@ class TypeWithKeyword : public Type {
56945694
TypeWithKeyword(ElaboratedTypeKeyword Keyword, TypeClass tc,
56955695
QualType Canonical, TypeDependence Dependence)
56965696
: Type(tc, Canonical, Dependence) {
5697-
TypeWithKeywordBits.Keyword = Keyword;
5697+
TypeWithKeywordBits.Keyword = llvm::to_underlying(Keyword);
56985698
}
56995699

57005700
public:
@@ -5800,7 +5800,7 @@ class ElaboratedType final
58005800
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword,
58015801
NestedNameSpecifier *NNS, QualType NamedType,
58025802
TagDecl *OwnedTagDecl) {
5803-
ID.AddInteger(Keyword);
5803+
ID.AddInteger(llvm::to_underlying(Keyword));
58045804
ID.AddPointer(NNS);
58055805
NamedType.Profile(ID);
58065806
ID.AddPointer(OwnedTagDecl);
@@ -5859,7 +5859,7 @@ class DependentNameType : public TypeWithKeyword, public llvm::FoldingSetNode {
58595859

58605860
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword,
58615861
NestedNameSpecifier *NNS, const IdentifierInfo *Name) {
5862-
ID.AddInteger(Keyword);
5862+
ID.AddInteger(llvm::to_underlying(Keyword));
58635863
ID.AddPointer(NNS);
58645864
ID.AddPointer(Name);
58655865
}

clang/include/clang/AST/TypeLoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ class ElaboratedTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
22942294
QualType getInnerType() const { return getTypePtr()->getNamedType(); }
22952295

22962296
bool isEmpty() const {
2297-
return getTypePtr()->getKeyword() == ElaboratedTypeKeyword::ETK_None &&
2297+
return getTypePtr()->getKeyword() == ElaboratedTypeKeyword::None &&
22982298
!getTypePtr()->getQualifier();
22992299
}
23002300

0 commit comments

Comments
 (0)