Skip to content

Commit 48581ba

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3269)
2 parents 3a394d9 + e720209 commit 48581ba

File tree

94 files changed

+1466
-2587
lines changed

Some content is hidden

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

94 files changed

+1466
-2587
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ Code completion
6767
Code actions
6868
^^^^^^^^^^^^
6969

70-
- New ``Override pure virtual methods`` code action. When invoked on a class
71-
definition, this action automatically generates C++ ``override`` declarations
72-
for all pure virtual methods inherited from its base classes that have not yet
73-
been implemented. The generated method stubs prompts the user for the actual
74-
implementation. The overrides are intelligently grouped under their original
75-
access specifiers (e.g., ``public``, ``protected``), creating new access
76-
specifier blocks if necessary.
77-
7870
Signature help
7971
^^^^^^^^^^^^^^
8072

@@ -93,11 +85,6 @@ Improvements to clang-doc
9385
Improvements to clang-query
9486
---------------------------
9587

96-
- Matcher queries interpreted by clang-query are now support trailing comma (,)
97-
in matcher arguments. Note that C++ still doesn't allow this in function
98-
arguments. So when porting a query to C++, remove all instances of trailing
99-
comma (otherwise C++ compiler will just complain about "expected expression").
100-
10188
Improvements to clang-tidy
10289
--------------------------
10390

@@ -110,22 +97,6 @@ New check aliases
11097
Changes in existing checks
11198
^^^^^^^^^^^^^^^^^^^^^^^^^^
11299

113-
- Improved :doc:`bugprone-infinite-loop
114-
<clang-tidy/checks/bugprone/infinite-loop>` check by adding detection for
115-
variables introduced by structured bindings.
116-
117-
- Improved :doc:`bugprone-unhandled-self-assignment
118-
<clang-tidy/checks/bugprone/unhandled-self-assignment>` check by adding
119-
an additional matcher that generalizes the copy-and-swap idiom pattern
120-
detection.
121-
122-
- Improved :doc:`misc-header-include-cycle
123-
<clang-tidy/checks/misc/header-include-cycle>` check performance.
124-
125-
- Improved :doc:`portability-template-virtual-member-function
126-
<clang-tidy/checks/portability/template-virtual-member-function>` check to
127-
avoid false positives on pure virtual member functions.
128-
129100
Removed checks
130101
^^^^^^^^^^^^^^
131102

@@ -152,4 +123,3 @@ Improvements to pp-trace
152123

153124
Clang-tidy Visual Studio plugin
154125
-------------------------------
155-

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 845 deletions
Large diffs are not rendered by default.

clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ llvm::Value *CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
274274

275275
void CodeGenFunction::AddAMDGPUFenceAddressSpaceMMRA(llvm::Instruction *Inst,
276276
const CallExpr *E) {
277-
constexpr const char *Tag = "amdgpu-as";
277+
constexpr const char *Tag = "amdgpu-synchronize-as";
278278

279279
LLVMContext &Ctx = Inst->getContext();
280280
SmallVector<MMRAMetadata::TagT, 3> MMRAs;

clang/lib/Format/ContinuationIndenter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,8 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
17251725
}
17261726
if (Previous && (Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr) ||
17271727
(Previous->isOneOf(tok::l_paren, tok::comma, tok::colon) &&
1728-
!Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)))) {
1728+
!Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr,
1729+
TT_CtorInitializerColon)))) {
17291730
CurrentState.NestedBlockInlined =
17301731
!Newline && hasNestedBlockInlined(Previous, Current, Style);
17311732
}

clang/lib/Sema/SemaAvailability.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,12 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K,
547547
return;
548548
}
549549
case AR_Deprecated:
550+
// Suppress -Wdeprecated-declarations in implicit
551+
// functions.
552+
if (const auto *FD = dyn_cast_or_null<FunctionDecl>(S.getCurFunctionDecl());
553+
FD && FD->isImplicit())
554+
return;
555+
550556
if (ObjCPropertyAccess)
551557
diag = diag::warn_property_method_deprecated;
552558
else if (S.currentEvaluationContext().IsCaseExpr)

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,8 @@ bool Sema::CheckAttrTarget(const ParsedAttr &AL) {
20412041
// Check whether the attribute is valid on the current target.
20422042
if (!AL.existsInTarget(Context.getTargetInfo())) {
20432043
if (AL.isRegularKeywordAttribute())
2044-
Diag(AL.getLoc(), diag::err_keyword_not_supported_on_target);
2044+
Diag(AL.getLoc(), diag::err_keyword_not_supported_on_target)
2045+
<< AL << AL.getRange();
20452046
else
20462047
DiagnoseUnknownAttribute(AL);
20472048
AL.setInvalid();

clang/lib/Sema/SemaTemplateDeduction.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,6 +5523,15 @@ static TemplateDeductionResult CheckDeductionConsistency(
55235523
// FIXME: A substitution can be incomplete on a non-structural part of the
55245524
// type. Use the canonical type for now, until the TemplateInstantiator can
55255525
// deal with that.
5526+
5527+
// Workaround: Implicit deduction guides use InjectedClassNameTypes, whereas
5528+
// the explicit guides don't. The substitution doesn't transform these types,
5529+
// so let it transform their specializations instead.
5530+
bool IsDeductionGuide = isa<CXXDeductionGuideDecl>(FTD->getTemplatedDecl());
5531+
if (IsDeductionGuide) {
5532+
if (auto *Injected = P->getAs<InjectedClassNameType>())
5533+
P = Injected->getInjectedSpecializationType();
5534+
}
55265535
QualType InstP = S.SubstType(P.getCanonicalType(), MLTAL, FTD->getLocation(),
55275536
FTD->getDeclName(), &IsIncompleteSubstitution);
55285537
if (InstP.isNull() && !IsIncompleteSubstitution)
@@ -5537,9 +5546,15 @@ static TemplateDeductionResult CheckDeductionConsistency(
55375546
if (auto *PA = dyn_cast<PackExpansionType>(A);
55385547
PA && !isa<PackExpansionType>(InstP))
55395548
A = PA->getPattern();
5540-
if (!S.Context.hasSameType(
5541-
S.Context.getUnqualifiedArrayType(InstP.getNonReferenceType()),
5542-
S.Context.getUnqualifiedArrayType(A.getNonReferenceType())))
5549+
auto T1 = S.Context.getUnqualifiedArrayType(InstP.getNonReferenceType());
5550+
auto T2 = S.Context.getUnqualifiedArrayType(A.getNonReferenceType());
5551+
if (IsDeductionGuide) {
5552+
if (auto *Injected = T1->getAs<InjectedClassNameType>())
5553+
T1 = Injected->getInjectedSpecializationType();
5554+
if (auto *Injected = T2->getAs<InjectedClassNameType>())
5555+
T2 = Injected->getInjectedSpecializationType();
5556+
}
5557+
if (!S.Context.hasSameType(T1, T2))
55435558
return TemplateDeductionResult::NonDeducedMismatch;
55445559
return TemplateDeductionResult::Success;
55455560
}

clang/test/CodeGenCXX/builtin-amdgcn-fence.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void test_mixed() {
105105
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "local", "local", "global", "local", "local");
106106
}
107107
//.
108-
// CHECK: [[META3]] = !{!"amdgpu-as", !"local"}
109-
// CHECK: [[META4]] = !{!"amdgpu-as", !"global"}
108+
// CHECK: [[META3]] = !{!"amdgpu-synchronize-as", !"local"}
109+
// CHECK: [[META4]] = !{!"amdgpu-synchronize-as", !"global"}
110110
// CHECK: [[META5]] = !{[[META4]], [[META3]]}
111111
//.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %clang_cc1 -std=c++20 -Wdeprecated-declarations -verify %s
2+
3+
struct A {
4+
[[deprecated("use something else")]] int x = 42; // expected-note {{marked deprecated here}}
5+
};
6+
7+
A makeDefaultA() { return {}; } // ctor is implicit → no warn
8+
A copyA(const A &a) { return a; } // copy-ctor implicit → no warn
9+
10+
void assignA() {
11+
A a, b;
12+
a = b; // copy-assign implicit → no warn
13+
}
14+
15+
void useA() {
16+
A a;
17+
(void)a.x; // expected-warning {{is deprecated}}
18+
}
19+
20+
// Explicitly-defaulted ctor – now silent
21+
struct B {
22+
[[deprecated]] int y;
23+
B() = default; // no warning under new policy
24+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %clang_cc1 -x c -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
2+
3+
void arm_streaming(void) __arm_streaming {} // expected-error {{'__arm_streaming' is not supported on this target}}

0 commit comments

Comments
 (0)