Skip to content

Commit 585148f

Browse files
authored
merge main into amd-staging (llvm#1668)
2 parents a18cc4c + cc791f0 commit 585148f

File tree

210 files changed

+3028
-2523
lines changed

Some content is hidden

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

210 files changed

+3028
-2523
lines changed

.ci/monolithic-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function at-exit {
3333

3434
mkdir -p artifacts
3535
ccache --print-stats > artifacts/ccache_stats.txt
36+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3637

3738
# If building fails there will be no results files.
3839
shopt -s nullglob

.ci/monolithic-windows.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function at-exit {
3232

3333
mkdir -p artifacts
3434
sccache --show-stats >> artifacts/sccache_stats.txt
35+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3536

3637
# If building fails there will be no results files.
3738
shopt -s nullglob

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ Windows Support
550550
- Clang now can process the `i128` and `ui128` integeral suffixes when MSVC
551551
extensions are enabled. This allows for properly processing ``intsafe.h`` in
552552
the Windows SDK.
553-
- Clang now supports MSVC vector deleting destructors (GH19772).
554553

555554
LoongArch Support
556555
^^^^^^^^^^^^^^^^^

clang/include/clang/AST/ASTContext.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,8 +1564,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
15641564
/// Return a non-unique reference to the type for a variable array of
15651565
/// the specified element type.
15661566
QualType getVariableArrayType(QualType EltTy, Expr *NumElts,
1567-
ArraySizeModifier ASM, unsigned IndexTypeQuals,
1568-
SourceRange Brackets) const;
1567+
ArraySizeModifier ASM,
1568+
unsigned IndexTypeQuals) const;
15691569

15701570
/// Return a non-unique reference to the type for a dependently-sized
15711571
/// array of the specified element type.
@@ -1574,8 +1574,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
15741574
/// point.
15751575
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts,
15761576
ArraySizeModifier ASM,
1577-
unsigned IndexTypeQuals,
1578-
SourceRange Brackets) const;
1577+
unsigned IndexTypeQuals) const;
15791578

15801579
/// Return a unique reference to the type for an incomplete array of
15811580
/// the specified element type.

clang/include/clang/AST/DeclCXX.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,6 @@ class CXXDestructorDecl : public CXXMethodDecl {
28522852
// FIXME: Don't allocate storage for these except in the first declaration
28532853
// of a virtual destructor.
28542854
FunctionDecl *OperatorDelete = nullptr;
2855-
FunctionDecl *OperatorArrayDelete = nullptr;
28562855
Expr *OperatorDeleteThisArg = nullptr;
28572856

28582857
CXXDestructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
@@ -2878,16 +2877,11 @@ class CXXDestructorDecl : public CXXMethodDecl {
28782877
static CXXDestructorDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
28792878

28802879
void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg);
2881-
void setOperatorArrayDelete(FunctionDecl *OD);
28822880

28832881
const FunctionDecl *getOperatorDelete() const {
28842882
return getCanonicalDecl()->OperatorDelete;
28852883
}
28862884

2887-
const FunctionDecl *getArrayOperatorDelete() const {
2888-
return getCanonicalDecl()->OperatorArrayDelete;
2889-
}
2890-
28912885
Expr *getOperatorDeleteThisArg() const {
28922886
return getCanonicalDecl()->OperatorDeleteThisArg;
28932887
}

clang/include/clang/AST/Type.h

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3827,14 +3827,9 @@ class VariableArrayType : public ArrayType {
38273827
/// a function block.
38283828
Stmt *SizeExpr;
38293829

3830-
/// The range spanned by the left and right array brackets.
3831-
SourceRange Brackets;
3832-
3833-
VariableArrayType(QualType et, QualType can, Expr *e,
3834-
ArraySizeModifier sm, unsigned tq,
3835-
SourceRange brackets)
3836-
: ArrayType(VariableArray, et, can, sm, tq, e),
3837-
SizeExpr((Stmt*) e), Brackets(brackets) {}
3830+
VariableArrayType(QualType et, QualType can, Expr *e, ArraySizeModifier sm,
3831+
unsigned tq)
3832+
: ArrayType(VariableArray, et, can, sm, tq, e), SizeExpr((Stmt *)e) {}
38383833

38393834
public:
38403835
friend class StmtIteratorBase;
@@ -3845,10 +3840,6 @@ class VariableArrayType : public ArrayType {
38453840
return (Expr*) SizeExpr;
38463841
}
38473842

3848-
SourceRange getBracketsRange() const { return Brackets; }
3849-
SourceLocation getLBracketLoc() const { return Brackets.getBegin(); }
3850-
SourceLocation getRBracketLoc() const { return Brackets.getEnd(); }
3851-
38523843
bool isSugared() const { return false; }
38533844
QualType desugar() const { return QualType(this, 0); }
38543845

@@ -3884,12 +3875,8 @@ class DependentSizedArrayType : public ArrayType {
38843875
/// type will have its size deduced from an initializer.
38853876
Stmt *SizeExpr;
38863877

3887-
/// The range spanned by the left and right array brackets.
3888-
SourceRange Brackets;
3889-
38903878
DependentSizedArrayType(QualType et, QualType can, Expr *e,
3891-
ArraySizeModifier sm, unsigned tq,
3892-
SourceRange brackets);
3879+
ArraySizeModifier sm, unsigned tq);
38933880

38943881
public:
38953882
friend class StmtIteratorBase;
@@ -3900,10 +3887,6 @@ class DependentSizedArrayType : public ArrayType {
39003887
return (Expr*) SizeExpr;
39013888
}
39023889

3903-
SourceRange getBracketsRange() const { return Brackets; }
3904-
SourceLocation getLBracketLoc() const { return Brackets.getBegin(); }
3905-
SourceLocation getRBracketLoc() const { return Brackets.getEnd(); }
3906-
39073890
bool isSugared() const { return false; }
39083891
QualType desugar() const { return QualType(this, 0); }
39093892

clang/include/clang/AST/TypeProperties.td

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,40 +154,22 @@ let Class = IncompleteArrayType in {
154154
}
155155

156156
let Class = VariableArrayType in {
157-
def : Property<"leftBracketLoc", SourceLocation> {
158-
let Read = [{ node->getLBracketLoc() }];
159-
}
160-
def : Property<"rightBracketLoc", SourceLocation> {
161-
let Read = [{ node->getRBracketLoc() }];
162-
}
163157
def : Property<"size", ExprRef> {
164158
let Read = [{ node->getSizeExpr() }];
165159
}
166160

167161
def : Creator<[{
168162
return ctx.getVariableArrayType(elementType, size, sizeModifier,
169-
indexQualifiers.getCVRQualifiers(),
170-
SourceRange(leftBracketLoc,
171-
rightBracketLoc));
163+
indexQualifiers.getCVRQualifiers());
172164
}]>;
173165
}
174166

175167
let Class = DependentSizedArrayType in {
176-
def : Property<"size", ExprRef> {
177-
let Read = [{ node->getSizeExpr() }];
178-
}
179-
def : Property<"leftBracketLoc", SourceLocation> {
180-
let Read = [{ node->getLBracketLoc() }];
181-
}
182-
def : Property<"rightBracketLoc", SourceLocation> {
183-
let Read = [{ node->getRBracketLoc() }];
184-
}
168+
def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; }
185169

186170
def : Creator<[{
187171
return ctx.getDependentSizedArrayType(elementType, size, sizeModifier,
188-
indexQualifiers.getCVRQualifiers(),
189-
SourceRange(leftBracketLoc,
190-
rightBracketLoc));
172+
indexQualifiers.getCVRQualifiers());
191173
}]>;
192174
}
193175

clang/include/clang/AST/VTableBuilder.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class VTableComponent {
150150

151151
bool isRTTIKind() const { return isRTTIKind(getKind()); }
152152

153-
GlobalDecl getGlobalDecl(bool HasVectorDeletingDtors) const {
153+
GlobalDecl getGlobalDecl() const {
154154
assert(isUsedFunctionPointerKind() &&
155155
"GlobalDecl can be created only from virtual function");
156156

@@ -161,9 +161,7 @@ class VTableComponent {
161161
case CK_CompleteDtorPointer:
162162
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Complete);
163163
case CK_DeletingDtorPointer:
164-
return GlobalDecl(DtorDecl, (HasVectorDeletingDtors)
165-
? CXXDtorType::Dtor_VectorDeleting
166-
: CXXDtorType::Dtor_Deleting);
164+
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Deleting);
167165
case CK_VCallOffset:
168166
case CK_VBaseOffset:
169167
case CK_OffsetToTop:

clang/include/clang/Basic/ABI.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ enum CXXCtorType {
3131

3232
/// C++ destructor types.
3333
enum CXXDtorType {
34-
Dtor_Deleting, ///< Deleting dtor
35-
Dtor_Complete, ///< Complete object dtor
36-
Dtor_Base, ///< Base object dtor
37-
Dtor_Comdat, ///< The COMDAT used for dtors
38-
Dtor_VectorDeleting ///< Vector deleting dtor
34+
Dtor_Deleting, ///< Deleting dtor
35+
Dtor_Complete, ///< Complete object dtor
36+
Dtor_Base, ///< Base object dtor
37+
Dtor_Comdat ///< The COMDAT used for dtors
3938
};
4039

4140
} // end namespace clang

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ LANGOPT(Coroutines , 1, 0, "C++20 coroutines")
161161
LANGOPT(CoroAlignedAllocation, 1, 0, "prefer Aligned Allocation according to P2014 Option 2")
162162
LANGOPT(DllExportInlines , 1, 1, "dllexported classes dllexport inline methods")
163163
LANGOPT(ExperimentalLibrary, 1, 0, "enable unstable and experimental library features")
164-
LANGOPT(RetainSubstTemplateTypeParmTypeAstNodes, 1, 0, "retain SubstTemplateTypeParmType nodes in the AST's representation of alias template specializations")
165164

166165
LANGOPT(PointerAuthIntrinsics, 1, 0, "pointer authentication intrinsics")
167166
LANGOPT(PointerAuthCalls , 1, 0, "function pointer authentication")

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,12 +3514,6 @@ defm application_extension : BoolFOption<"application-extension",
35143514
PosFlag<SetTrue, [], [ClangOption, CC1Option],
35153515
"Restrict code to those available for App Extensions">,
35163516
NegFlag<SetFalse>>;
3517-
defm retain_subst_template_type_parm_type_ast_nodes : BoolFOption<"retain-subst-template-type-parm-type-ast-nodes",
3518-
LangOpts<"RetainSubstTemplateTypeParmTypeAstNodes">, DefaultFalse,
3519-
PosFlag<SetTrue, [], [CC1Option], "Enable">,
3520-
NegFlag<SetFalse, [], [], "Disable">,
3521-
BothFlags<[], [], " retain SubstTemplateTypeParmType nodes in the AST's representation"
3522-
" of alias template specializations">>;
35233517
defm sized_deallocation : BoolFOption<"sized-deallocation",
35243518
LangOpts<"SizedDeallocation">, Default<cpp14.KeyPath>,
35253519
PosFlag<SetTrue, [], [], "Enable C++14 sized global deallocation functions">,

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8366,7 +8366,6 @@ class Sema final : public SemaBase {
83668366
DeclarationName Name);
83678367
FunctionDecl *FindDeallocationFunctionForDestructor(SourceLocation StartLoc,
83688368
CXXRecordDecl *RD,
8369-
DeclarationName Name,
83708369
bool Diagnose = true);
83718370

83728371
/// ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:

clang/lib/AST/ASTContext.cpp

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,11 +4261,8 @@ QualType ASTContext::getVariableArrayDecayedType(QualType type) const {
42614261
case Type::DependentSizedArray: {
42624262
const auto *dat = cast<DependentSizedArrayType>(ty);
42634263
result = getDependentSizedArrayType(
4264-
getVariableArrayDecayedType(dat->getElementType()),
4265-
dat->getSizeExpr(),
4266-
dat->getSizeModifier(),
4267-
dat->getIndexTypeCVRQualifiers(),
4268-
dat->getBracketsRange());
4264+
getVariableArrayDecayedType(dat->getElementType()), dat->getSizeExpr(),
4265+
dat->getSizeModifier(), dat->getIndexTypeCVRQualifiers());
42694266
break;
42704267
}
42714268

@@ -4275,17 +4272,17 @@ QualType ASTContext::getVariableArrayDecayedType(QualType type) const {
42754272
result =
42764273
getVariableArrayType(getVariableArrayDecayedType(iat->getElementType()),
42774274
/*size*/ nullptr, ArraySizeModifier::Normal,
4278-
iat->getIndexTypeCVRQualifiers(), SourceRange());
4275+
iat->getIndexTypeCVRQualifiers());
42794276
break;
42804277
}
42814278

42824279
// Turn VLA types into [*] types.
42834280
case Type::VariableArray: {
42844281
const auto *vat = cast<VariableArrayType>(ty);
4285-
result = getVariableArrayType(
4286-
getVariableArrayDecayedType(vat->getElementType()),
4287-
/*size*/ nullptr, ArraySizeModifier::Star,
4288-
vat->getIndexTypeCVRQualifiers(), vat->getBracketsRange());
4282+
result =
4283+
getVariableArrayType(getVariableArrayDecayedType(vat->getElementType()),
4284+
/*size*/ nullptr, ArraySizeModifier::Star,
4285+
vat->getIndexTypeCVRQualifiers());
42894286
break;
42904287
}
42914288
}
@@ -4298,8 +4295,7 @@ QualType ASTContext::getVariableArrayDecayedType(QualType type) const {
42984295
/// variable array of the specified element type.
42994296
QualType ASTContext::getVariableArrayType(QualType EltTy, Expr *NumElts,
43004297
ArraySizeModifier ASM,
4301-
unsigned IndexTypeQuals,
4302-
SourceRange Brackets) const {
4298+
unsigned IndexTypeQuals) const {
43034299
// Since we don't unique expressions, it isn't possible to unique VLA's
43044300
// that have an expression provided for their size.
43054301
QualType Canon;
@@ -4309,12 +4305,12 @@ QualType ASTContext::getVariableArrayType(QualType EltTy, Expr *NumElts,
43094305
if (!EltTy.isCanonical() || EltTy.hasLocalQualifiers()) {
43104306
SplitQualType canonSplit = getCanonicalType(EltTy).split();
43114307
Canon = getVariableArrayType(QualType(canonSplit.Ty, 0), NumElts, ASM,
4312-
IndexTypeQuals, Brackets);
4308+
IndexTypeQuals);
43134309
Canon = getQualifiedType(Canon, canonSplit.Quals);
43144310
}
43154311

43164312
auto *New = new (*this, alignof(VariableArrayType))
4317-
VariableArrayType(EltTy, Canon, NumElts, ASM, IndexTypeQuals, Brackets);
4313+
VariableArrayType(EltTy, Canon, NumElts, ASM, IndexTypeQuals);
43184314

43194315
VariableArrayTypes.push_back(New);
43204316
Types.push_back(New);
@@ -4324,11 +4320,10 @@ QualType ASTContext::getVariableArrayType(QualType EltTy, Expr *NumElts,
43244320
/// getDependentSizedArrayType - Returns a non-unique reference to
43254321
/// the type for a dependently-sized array of the specified element
43264322
/// type.
4327-
QualType ASTContext::getDependentSizedArrayType(QualType elementType,
4328-
Expr *numElements,
4329-
ArraySizeModifier ASM,
4330-
unsigned elementTypeQuals,
4331-
SourceRange brackets) const {
4323+
QualType
4324+
ASTContext::getDependentSizedArrayType(QualType elementType, Expr *numElements,
4325+
ArraySizeModifier ASM,
4326+
unsigned elementTypeQuals) const {
43324327
assert((!numElements || numElements->isTypeDependent() ||
43334328
numElements->isValueDependent()) &&
43344329
"Size must be type- or value-dependent!");
@@ -4354,7 +4349,7 @@ QualType ASTContext::getDependentSizedArrayType(QualType elementType,
43544349

43554350
auto *newType = new (*this, alignof(DependentSizedArrayType))
43564351
DependentSizedArrayType(elementType, QualType(), numElements, ASM,
4357-
elementTypeQuals, brackets);
4352+
elementTypeQuals);
43584353
DependentSizedArrayTypes.InsertNode(newType, insertPos);
43594354
Types.push_back(newType);
43604355
return QualType(newType, 0);
@@ -4364,7 +4359,7 @@ QualType ASTContext::getDependentSizedArrayType(QualType elementType,
43644359
if (!canonTy) {
43654360
canonTy = new (*this, alignof(DependentSizedArrayType))
43664361
DependentSizedArrayType(QualType(canonElementType.Ty, 0), QualType(),
4367-
numElements, ASM, elementTypeQuals, brackets);
4362+
numElements, ASM, elementTypeQuals);
43684363
DependentSizedArrayTypes.InsertNode(canonTy, insertPos);
43694364
Types.push_back(canonTy);
43704365
}
@@ -4383,7 +4378,7 @@ QualType ASTContext::getDependentSizedArrayType(QualType elementType,
43834378
// of the element type.
43844379
auto *sugaredType = new (*this, alignof(DependentSizedArrayType))
43854380
DependentSizedArrayType(elementType, canon, numElements, ASM,
4386-
elementTypeQuals, brackets);
4381+
elementTypeQuals);
43874382
Types.push_back(sugaredType);
43884383
return QualType(sugaredType, 0);
43894384
}
@@ -6775,17 +6770,14 @@ QualType ASTContext::getUnqualifiedArrayType(QualType type,
67756770
}
67766771

67776772
if (const auto *VAT = dyn_cast<VariableArrayType>(AT)) {
6778-
return getVariableArrayType(unqualElementType,
6779-
VAT->getSizeExpr(),
6773+
return getVariableArrayType(unqualElementType, VAT->getSizeExpr(),
67806774
VAT->getSizeModifier(),
6781-
VAT->getIndexTypeCVRQualifiers(),
6782-
VAT->getBracketsRange());
6775+
VAT->getIndexTypeCVRQualifiers());
67836776
}
67846777

67856778
const auto *DSAT = cast<DependentSizedArrayType>(AT);
67866779
return getDependentSizedArrayType(unqualElementType, DSAT->getSizeExpr(),
6787-
DSAT->getSizeModifier(), 0,
6788-
SourceRange());
6780+
DSAT->getSizeModifier(), 0);
67896781
}
67906782

67916783
/// Attempt to unwrap two types that may both be array types with the same bound
@@ -7729,19 +7721,14 @@ const ArrayType *ASTContext::getAsArrayType(QualType T) const {
77297721
IAT->getIndexTypeCVRQualifiers()));
77307722

77317723
if (const auto *DSAT = dyn_cast<DependentSizedArrayType>(ATy))
7732-
return cast<ArrayType>(
7733-
getDependentSizedArrayType(NewEltTy,
7734-
DSAT->getSizeExpr(),
7735-
DSAT->getSizeModifier(),
7736-
DSAT->getIndexTypeCVRQualifiers(),
7737-
DSAT->getBracketsRange()));
7724+
return cast<ArrayType>(getDependentSizedArrayType(
7725+
NewEltTy, DSAT->getSizeExpr(), DSAT->getSizeModifier(),
7726+
DSAT->getIndexTypeCVRQualifiers()));
77387727

77397728
const auto *VAT = cast<VariableArrayType>(ATy);
7740-
return cast<ArrayType>(getVariableArrayType(NewEltTy,
7741-
VAT->getSizeExpr(),
7742-
VAT->getSizeModifier(),
7743-
VAT->getIndexTypeCVRQualifiers(),
7744-
VAT->getBracketsRange()));
7729+
return cast<ArrayType>(
7730+
getVariableArrayType(NewEltTy, VAT->getSizeExpr(), VAT->getSizeModifier(),
7731+
VAT->getIndexTypeCVRQualifiers()));
77457732
}
77467733

77477734
QualType ASTContext::getAdjustedParameterType(QualType T) const {
@@ -13846,10 +13833,7 @@ static QualType getCommonNonSugarTypeNode(ASTContext &Ctx, const Type *X,
1384613833
return Ctx.getDependentSizedArrayType(
1384713834
getCommonArrayElementType(Ctx, AX, QX, AY, QY),
1384813835
getCommonSizeExpr(Ctx, AX, AY), getCommonSizeModifier(AX, AY),
13849-
getCommonIndexTypeCVRQualifiers(AX, AY),
13850-
AX->getBracketsRange() == AY->getBracketsRange()
13851-
? AX->getBracketsRange()
13852-
: SourceRange());
13836+
getCommonIndexTypeCVRQualifiers(AX, AY));
1385313837
}
1385413838
case Type::ConstantArray: {
1385513839
const auto *AX = cast<ConstantArrayType>(X),

0 commit comments

Comments
 (0)