Skip to content

Commit d49e957

Browse files
author
Georgios Rokos
committed
Merge from '"main"' to '"sycl-web"' (46 commits)
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaDecl.cpp
2 parents 816a237 + a162b67 commit d49e957

File tree

407 files changed

+130963
-32902
lines changed

Some content is hidden

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

407 files changed

+130963
-32902
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ Build System Changes
184184
AST Matchers
185185
------------
186186

187-
- ...
187+
- ``TypeLoc`` AST Matchers are now available. These matchers provide helpful
188+
utilities for matching ``TypeLoc`` nodes, such as the ``pointerTypeLoc``
189+
matcher or the ``hasReturnTypeLoc`` matcher. The addition of these matchers
190+
was made possible by changes to the handling of ``TypeLoc`` nodes that
191+
allows them to enjoy the same static type checking as other AST node kinds.
188192

189193
clang-format
190194
------------

clang/include/clang/Basic/Attr.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ def Availability : InheritableAttr {
870870
[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
871871
return llvm::StringSwitch<llvm::StringRef>(Platform)
872872
.Case("android", "Android")
873+
.Case("fuchsia", "Fuchsia")
873874
.Case("ios", "iOS")
874875
.Case("macos", "macOS")
875876
.Case("tvos", "tvOS")
@@ -2435,11 +2436,11 @@ def BPFPreserveAccessIndex : InheritableAttr,
24352436
let LangOpts = [COnly];
24362437
}
24372438

2438-
def BTFTag : DeclOrTypeAttr {
2439-
let Spellings = [Clang<"btf_tag">];
2440-
let Args = [StringArgument<"BTFTag">];
2439+
def BTFDeclTag : InheritableAttr {
2440+
let Spellings = [Clang<"btf_decl_tag">];
2441+
let Args = [StringArgument<"BTFDeclTag">];
24412442
let Subjects = SubjectList<[Var, Function, Record, Field], ErrorDiag>;
2442-
let Documentation = [BTFTagDocs];
2443+
let Documentation = [BTFDeclTagDocs];
24432444
let LangOpts = [COnly];
24442445
}
24452446

clang/include/clang/Basic/AttrDocs.td

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,18 +2039,14 @@ preserving struct or union member access debuginfo indices of this
20392039
struct or union, similar to clang ``__builtin_preserve_access_index()``.
20402040
}];
20412041
}
2042-
def BTFTagDocs : Documentation {
2042+
def BTFDeclTagDocs : Documentation {
20432043
let Category = DocCatFunction;
20442044
let Content = [{
2045-
Clang supports the ``__attribute__((btf_tag("ARGUMENT")))`` attribute for all
2046-
targets. This attribute may be attached to a struct/union, struct/union field,
2047-
function, function parameter or variable declaration. If -g is specified,
2045+
Clang supports the ``__attribute__((btf_decl_tag("ARGUMENT")))`` attribute for
2046+
all targets. This attribute may be attached to a struct/union, struct/union
2047+
field, function, function parameter or variable declaration. If -g is specified,
20482048
the ``ARGUMENT`` info will be preserved in IR and be emitted to dwarf.
20492049
For BPF targets, the ``ARGUMENT`` info will be emitted to .BTF ELF section too.
2050-
2051-
The attribute can also be used as a type qualifier. Right now it is accepted
2052-
and silently ignored in order to permit the linux kernel to build with the
2053-
attribute.
20542050
}];
20552051
}
20562052

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,9 @@ def warn_availability_swift_unavailable_deprecated_only : Warning<
35983598
InGroup<Availability>;
35993599
def note_protocol_method : Note<
36003600
"protocol method is here">;
3601+
def warn_availability_fuchsia_unavailable_minor : Warning<
3602+
"Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3603+
InGroup<Availability>;
36013604

36023605
def warn_unguarded_availability :
36033606
Warning<"%0 is only available on %1 %2 or newer">,

clang/include/clang/Basic/IdentifierTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ using IdentifierLocPair = std::pair<IdentifierInfo *, SourceLocation>;
7373
/// of a pointer to one of these classes.
7474
enum { IdentifierInfoAlignment = 8 };
7575

76-
static constexpr int ObjCOrBuiltinIDBits = 16;
76+
static constexpr int ObjCOrBuiltinIDBits = 17;
7777

7878
/// One of these records is kept for each identifier that
7979
/// is lexed. This contains information about whether the token was \#define'd,

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32,
451451
"Controls how scalar integer arguments are extended in calls "
452452
"to unprototyped and varargs functions")
453453

454+
VALUE_LANGOPT(FuchsiaAPILevel, 32, 0, "Fuchsia API level")
455+
454456
#undef LANGOPT
455457
#undef COMPATIBLE_LANGOPT
456458
#undef BENIGN_LANGOPT

clang/include/clang/Basic/riscv_vector.td

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,13 @@ let HasNoMaskedOverloaded = false,
599599
IntrinsicTypes = {ResultType, Ops[1]->getType()};
600600
Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo());
601601
}],
602-
ManualCodegenMask= [{
602+
ManualCodegenMask = [{
603603
// Move mask to right before vl.
604-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
604+
if (Ops.size() == 4) {
605+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
606+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
607+
} else if (Ops.size() == 5)
608+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
605609
IntrinsicTypes = {ResultType, Ops[3]->getType()};
606610
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
607611
}] in {
@@ -644,7 +648,11 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
644648
ManualCodegenMask = [{
645649
{
646650
// Move mask to right before vl.
647-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
651+
if (Ops.size() == 5) {
652+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
653+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
654+
} else if (Ops.size() == 6)
655+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
648656
IntrinsicTypes = {ResultType, Ops[4]->getType()};
649657
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
650658
Value *NewVL = Ops[2];
@@ -681,7 +689,11 @@ multiclass RVVVLSEBuiltin<list<string> types> {
681689
}],
682690
ManualCodegenMask= [{
683691
// Move mask to right before vl.
684-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
692+
if (Ops.size() == 5) {
693+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
694+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
695+
} else if (Ops.size() == 6)
696+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
685697
IntrinsicTypes = {ResultType, Ops[4]->getType()};
686698
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
687699
}] in {
@@ -701,7 +713,11 @@ multiclass RVVIndexedLoad<string op> {
701713
}],
702714
ManualCodegenMask = [{
703715
// Move mask to right before vl.
704-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
716+
if (Ops.size() == 5) {
717+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
718+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
719+
} else if (Ops.size() == 6)
720+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
705721
IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops[4]->getType()};
706722
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
707723
}] in {
@@ -885,7 +901,10 @@ multiclass RVVUnitStridedSegLoad<string op> {
885901
Operands.push_back(Ops[2 * NF + 1]);
886902
Operands.push_back(Ops[NF]);
887903
Operands.push_back(Ops[2 * NF + 2]);
888-
Operands.push_back(Ops[2 * NF + 3]);
904+
if (Ops.size() == 2 * NF + 4)
905+
Operands.push_back(Ops[2 * NF + 3]);
906+
else
907+
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
889908
assert(Operands.size() == NF + 4);
890909
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
891910
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
@@ -958,7 +977,10 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
958977
Operands.push_back(Ops[2 * NF + 1]);
959978
Operands.push_back(Ops[NF]);
960979
Operands.push_back(Ops[2 * NF + 3]);
961-
Operands.push_back(Ops[2 * NF + 4]);
980+
if (Ops.size() == 2 * NF + 5)
981+
Operands.push_back(Ops[2 * NF + 4]);
982+
else
983+
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
962984
Value *NewVL = Ops[2 * NF + 2];
963985
assert(Operands.size() == NF + 4);
964986
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
@@ -1032,7 +1054,10 @@ multiclass RVVStridedSegLoad<string op> {
10321054
Operands.push_back(Ops[2 * NF + 2]);
10331055
Operands.push_back(Ops[NF]);
10341056
Operands.push_back(Ops[2 * NF + 3]);
1035-
Operands.push_back(Ops[2 * NF + 4]);
1057+
if (Ops.size() == 2 * NF + 5)
1058+
Operands.push_back(Ops[2 * NF + 4]);
1059+
else
1060+
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
10361061
assert(Operands.size() == NF + 5);
10371062
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
10381063
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
@@ -1099,7 +1124,10 @@ multiclass RVVIndexedSegLoad<string op> {
10991124
Operands.push_back(Ops[2 * NF + 2]);
11001125
Operands.push_back(Ops[NF]);
11011126
Operands.push_back(Ops[2 * NF + 3]);
1102-
Operands.push_back(Ops[2 * NF + 4]);
1127+
if (Ops.size() == 2 * NF + 5)
1128+
Operands.push_back(Ops[2 * NF + 4]);
1129+
else
1130+
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
11031131
assert(Operands.size() == NF + 5);
11041132
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
11051133
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
@@ -1318,7 +1346,11 @@ multiclass RVVPseudoUnaryBuiltin<string IR, string type_range> {
13181346
}],
13191347
ManualCodegenMask = [{
13201348
{
1321-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
1349+
if (Ops.size() == 4) {
1350+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
1351+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
1352+
} else if (Ops.size() == 5)
1353+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
13221354
// maskedoff, op1, mask, vl
13231355
IntrinsicTypes = {ResultType,
13241356
cast<llvm::VectorType>(ResultType)->getElementType(),
@@ -1348,7 +1380,11 @@ multiclass RVVPseudoVNotBuiltin<string IR, string type_range> {
13481380
}],
13491381
ManualCodegenMask = [{
13501382
{
1351-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
1383+
if (Ops.size() == 4) {
1384+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
1385+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
1386+
} else if (Ops.size() == 5)
1387+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
13521388
// maskedoff, op1, mask, vl
13531389
IntrinsicTypes = {ResultType,
13541390
cast<llvm::VectorType>(ResultType)->getElementType(),
@@ -1395,7 +1431,11 @@ multiclass RVVPseudoVFUnaryBuiltin<string IR, string type_range> {
13951431
}],
13961432
ManualCodegenMask = [{
13971433
{
1398-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
1434+
if (Ops.size() == 4) {
1435+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
1436+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
1437+
} else if (Ops.size() == 5)
1438+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
13991439
// maskedoff, op1, mask, vl
14001440
IntrinsicTypes = {ResultType,
14011441
Ops[1]->getType(),
@@ -1427,7 +1467,11 @@ multiclass RVVPseudoVWCVTBuiltin<string IR, string MName, string type_range,
14271467
}],
14281468
ManualCodegenMask = [{
14291469
{
1430-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
1470+
if (Ops.size() == 4) {
1471+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
1472+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
1473+
} else if (Ops.size() == 5)
1474+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
14311475
// maskedoff, op1, mask, vl
14321476
IntrinsicTypes = {ResultType,
14331477
Ops[1]->getType(),
@@ -1462,7 +1506,11 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range,
14621506
}],
14631507
ManualCodegenMask = [{
14641508
{
1465-
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
1509+
if (Ops.size() == 4) {
1510+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
1511+
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_AGNOSTIC));
1512+
} else if (Ops.size() == 5)
1513+
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 2);
14661514
// maskedoff, op1, mask, vl
14671515
IntrinsicTypes = {ResultType,
14681516
Ops[1]->getType(),

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,9 @@ def mlinker_version_EQ : Joined<["-"], "mlinker-version=">,
32693269
def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option,CC1AsOption,CoreOption]>,
32703270
HelpText<"Additional arguments to forward to LLVM's option processing">,
32713271
MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
3272+
def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
3273+
Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
3274+
MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
32723275
def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
32733276
Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
32743277
def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3649,7 +3649,7 @@ class Sema final {
36493649
EnforceTCBAttr *mergeEnforceTCBAttr(Decl *D, const EnforceTCBAttr &AL);
36503650
EnforceTCBLeafAttr *mergeEnforceTCBLeafAttr(Decl *D,
36513651
const EnforceTCBLeafAttr &AL);
3652-
BTFTagAttr *mergeBTFTagAttr(Decl *D, const BTFTagAttr &AL);
3652+
BTFDeclTagAttr *mergeBTFDeclTagAttr(Decl *D, const BTFDeclTagAttr &AL);
36533653

36543654
void mergeDeclAttributes(NamedDecl *New, Decl *Old,
36553655
AvailabilityMergeKind AMK = AMK_Redeclaration);

clang/lib/AST/TypePrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,6 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
17231723
case attr::UPtr:
17241724
case attr::AddressSpace:
17251725
case attr::CmseNSCall:
1726-
case attr::BTFTag:
17271726
llvm_unreachable("This attribute should have been handled already");
17281727

17291728
case attr::NSReturnsRetained:

0 commit comments

Comments
 (0)