Skip to content

Commit aa1c284

Browse files
authored
Merge pull request #447 from Xilinx/bump_to_a1c9dd7c
[AutoBump] Merge with fixes of a1c9dd7 (Oct 10) (10)
2 parents c86e97b + 88d6c0c commit aa1c284

File tree

636 files changed

+21445
-27534
lines changed

Some content is hidden

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

636 files changed

+21445
-27534
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ function keep-modified-projects() {
191191
}
192192

193193
function check-targets() {
194+
# Do not use "check-all" here because if there is "check-all" plus a
195+
# project specific target like "check-clang", that project's tests
196+
# will be run twice.
194197
projects=${@}
195198
for project in ${projects}; do
196199
case ${project} in
@@ -216,7 +219,7 @@ function check-targets() {
216219
echo "check-lldb"
217220
;;
218221
pstl)
219-
echo "check-all"
222+
# Currently we do not run pstl tests in CI.
220223
;;
221224
libclc)
222225
# Currently there is no testing for libclc.

clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,8 @@ groupReplacements(const TUReplacements &TUs, const TUDiagnostics &TUDs,
148148

149149
if (auto Entry = SM.getFileManager().getOptionalFileRef(Path)) {
150150
if (SourceTU) {
151-
auto &Replaces = DiagReplacements[*Entry];
152-
auto It = Replaces.find(R);
153-
if (It == Replaces.end())
154-
Replaces.emplace(R, SourceTU);
155-
else if (It->second != SourceTU)
151+
auto [It, Inserted] = DiagReplacements[*Entry].try_emplace(R, SourceTU);
152+
if (!Inserted && It->second != SourceTU)
156153
// This replacement is a duplicate of one suggested by another TU.
157154
return;
158155
}

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,8 @@ void ChangeNamespaceTool::run(
606606
Result.Nodes.getNodeAs<DeclRefExpr>("func_ref")) {
607607
// If this reference has been processed as a function call, we do not
608608
// process it again.
609-
if (ProcessedFuncRefs.count(FuncRef))
609+
if (!ProcessedFuncRefs.insert(FuncRef).second)
610610
return;
611-
ProcessedFuncRefs.insert(FuncRef);
612611
const auto *Func = Result.Nodes.getNodeAs<FunctionDecl>("func_decl");
613612
assert(Func);
614613
const auto *Context = Result.Nodes.getNodeAs<Decl>("dc");

clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ void ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit() {
146146
}
147147
// Check if a definition in another namespace exists.
148148
const auto DeclName = CurDecl->getName();
149-
if (!DeclNameToDefinitions.contains(DeclName)) {
149+
auto It = DeclNameToDefinitions.find(DeclName);
150+
if (It == DeclNameToDefinitions.end()) {
150151
continue; // No definition in this translation unit, we can skip it.
151152
}
152153
// Make a warning for each definition with the same name (in other
153154
// namespaces).
154-
const auto &Definitions = DeclNameToDefinitions[DeclName];
155+
const auto &Definitions = It->second;
155156
for (const auto *Def : Definitions) {
156157
diag(CurDecl->getLocation(),
157158
"no definition found for %0, but a definition with "

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
345345
set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
346346
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
347347
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
348+
set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
348349
set(RUNTIMES_${target}_LIBCXX_LIBC "llvm-libc" CACHE STRING "")
349350
set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
350351
set(RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
@@ -396,6 +397,7 @@ foreach(target riscv32-unknown-elf)
396397
set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
397398
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
398399
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
400+
set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
399401
set(RUNTIMES_${target}_LIBCXX_LIBC "llvm-libc" CACHE STRING "")
400402
set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
401403
set(RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")

clang/docs/ReleaseNotes.rst

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ C++ Specific Potentially Breaking Changes
9999
// Was error, now evaluates to false.
100100
constexpr bool b = f() == g();
101101
102+
- The warning ``-Wdeprecated-literal-operator`` is now on by default, as this is
103+
something that WG21 has shown interest in removing from the language. The
104+
result is that anyone who is compiling with ``-Werror`` should see this
105+
diagnostic. To fix this diagnostic, simply removing the space character from
106+
between the ``operator""`` and the user defined literal name will make the
107+
source no longer deprecated. This is consistent with `CWG2521 <https://cplusplus.github.io/CWG/issues/2521.html>_`.
108+
109+
.. code-block:: c++
110+
111+
// Now diagnoses by default.
112+
unsigned operator"" _udl_name(unsigned long long);
113+
// Fixed version:
114+
unsigned operator""_udl_name(unsigned long long);
115+
102116
ABI Changes in This Version
103117
---------------------------
104118

@@ -171,13 +185,12 @@ C++23 Feature Support
171185
^^^^^^^^^^^^^^^^^^^^^
172186
- Removed the restriction to literal types in constexpr functions in C++23 mode.
173187

188+
- Extend lifetime of temporaries in mem-default-init for P2718R0. Clang now fully
189+
supports `P2718R0 Lifetime extension in range-based for loops <https://wg21.link/P2718R0>`_.
190+
174191
C++20 Feature Support
175192
^^^^^^^^^^^^^^^^^^^^^
176193

177-
C++17 Feature Support
178-
^^^^^^^^^^^^^^^^^^^^^
179-
- The implementation of the relaxed template template argument matching rules is
180-
more complete and reliable, and should provide more accurate diagnostics.
181194

182195
Resolutions to C++ Defect Reports
183196
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -204,8 +217,7 @@ Resolutions to C++ Defect Reports
204217
(`CWG2351: void{} <https://cplusplus.github.io/CWG/issues/2351.html>`_).
205218

206219
- Clang now has improved resolution to CWG2398, allowing class templates to have
207-
default arguments deduced when partial ordering, and better backwards compatibility
208-
in overload resolution.
220+
default arguments deduced when partial ordering.
209221

210222
- Clang now allows comparing unequal object pointers that have been cast to ``void *``
211223
in constant expressions. These comparisons always worked in non-constant expressions.
@@ -217,6 +229,10 @@ Resolutions to C++ Defect Reports
217229
- Clang now allows trailing requires clause on explicit deduction guides.
218230
(`CWG2707: Deduction guides cannot have a trailing requires-clause <https://cplusplus.github.io/CWG/issues/2707.html>`_).
219231

232+
- Clang now diagnoses a space in the first production of a ``literal-operator-id``
233+
by default.
234+
(`CWG2521: User-defined literals and reserved identifiers <https://cplusplus.github.io/CWG/issues/2521.html>`_).
235+
220236
C Language Changes
221237
------------------
222238

@@ -336,10 +352,6 @@ Improvements to Clang's diagnostics
336352

337353
- Clang now diagnoses when the result of a [[nodiscard]] function is discarded after being cast in C. Fixes #GH104391.
338354

339-
- Clang now properly explains the reason a template template argument failed to
340-
match a template template parameter, in terms of the C++17 relaxed matching rules
341-
instead of the old ones.
342-
343355
- Don't emit duplicated dangling diagnostics. (#GH93386).
344356

345357
- Improved diagnostic when trying to befriend a concept. (#GH45182).
@@ -384,6 +396,10 @@ Improvements to Clang's diagnostics
384396
- The warning for an unsupported type for a named register variable is now phrased ``unsupported type for named register variable``,
385397
instead of ``bad type for named register variable``. This makes it clear that the type is not supported at all, rather than being
386398
suboptimal in some way the error fails to mention (#GH111550).
399+
400+
- Clang now emits a ``-Wdepredcated-literal-operator`` diagnostic, even if the
401+
name was a reserved name, which we improperly allowed to suppress the
402+
diagnostic.
387403

388404
Improvements to Clang's time-trace
389405
----------------------------------
@@ -449,8 +465,6 @@ Bug Fixes to C++ Support
449465
- Correctly check constraints of explicit instantiations of member functions. (#GH46029)
450466
- When performing partial ordering of function templates, clang now checks that
451467
the deduction was consistent. Fixes (#GH18291).
452-
- Fixes to several issues in partial ordering of template template parameters, which
453-
were documented in the test suite.
454468
- Fixed an assertion failure about a constraint of a friend function template references to a value with greater
455469
template depth than the friend function template. (#GH98258)
456470
- Clang now rebuilds the template parameters of out-of-line declarations and specializations in the context
@@ -633,6 +647,9 @@ AST Matchers
633647

634648
- Fixed a crash when traverse lambda expr with invalid captures. (#GH106444)
635649

650+
- Ensure ``hasName`` matches template specializations across inline namespaces,
651+
making `matchesNodeFullSlow` and `matchesNodeFullFast` consistent.
652+
636653
clang-format
637654
------------
638655

clang/include/clang/AST/Attr.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,23 @@ class InheritableParamAttr : public InheritableAttr {
197197
}
198198
};
199199

200+
class InheritableParamOrStmtAttr : public InheritableParamAttr {
201+
protected:
202+
InheritableParamOrStmtAttr(ASTContext &Context,
203+
const AttributeCommonInfo &CommonInfo,
204+
attr::Kind AK, bool IsLateParsed,
205+
bool InheritEvenIfAlreadyPresent)
206+
: InheritableParamAttr(Context, CommonInfo, AK, IsLateParsed,
207+
InheritEvenIfAlreadyPresent) {}
208+
209+
public:
210+
// Implement isa/cast/dyncast/etc.
211+
static bool classof(const Attr *A) {
212+
return A->getKind() >= attr::FirstInheritableParamOrStmtAttr &&
213+
A->getKind() <= attr::LastInheritableParamOrStmtAttr;
214+
}
215+
};
216+
200217
class HLSLAnnotationAttr : public InheritableAttr {
201218
protected:
202219
HLSLAnnotationAttr(ASTContext &Context, const AttributeCommonInfo &CommonInfo,

clang/include/clang/AST/PrettyPrinter.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ class PrintingCallbacks {
5555
/// This type is intended to be small and suitable for passing by value.
5656
/// It is very frequently copied.
5757
struct PrintingPolicy {
58+
enum SuppressInlineNamespaceMode : uint8_t { None, Redundant, All };
59+
5860
/// Create a default printing policy for the specified language.
5961
PrintingPolicy(const LangOptions &LO)
6062
: Indentation(2), SuppressSpecifiers(false),
6163
SuppressTagKeyword(LO.CPlusPlus), IncludeTagDefinition(false),
6264
SuppressScope(false), SuppressUnwrittenScope(false),
63-
SuppressInlineNamespace(true), SuppressElaboration(false),
64-
SuppressInitializers(false), ConstantArraySizeAsWritten(false),
65-
AnonymousTagLocations(true), SuppressStrongLifetime(false),
66-
SuppressLifetimeQualifiers(false),
65+
SuppressInlineNamespace(SuppressInlineNamespaceMode::Redundant),
66+
SuppressElaboration(false), SuppressInitializers(false),
67+
ConstantArraySizeAsWritten(false), AnonymousTagLocations(true),
68+
SuppressStrongLifetime(false), SuppressLifetimeQualifiers(false),
6769
SuppressTemplateArgsInCXXConstructors(false),
6870
SuppressDefaultTemplateArgs(true), Bool(LO.Bool),
6971
Nullptr(LO.CPlusPlus11 || LO.C23), NullptrTypeInNamespace(LO.CPlusPlus),
@@ -141,10 +143,12 @@ struct PrintingPolicy {
141143
unsigned SuppressUnwrittenScope : 1;
142144

143145
/// Suppress printing parts of scope specifiers that correspond
144-
/// to inline namespaces, where the name is unambiguous with the specifier
146+
/// to inline namespaces.
147+
/// If Redudant, where the name is unambiguous with the specifier removed.
148+
/// If All, even if the name is ambiguous with the specifier
145149
/// removed.
146-
LLVM_PREFERRED_TYPE(bool)
147-
unsigned SuppressInlineNamespace : 1;
150+
LLVM_PREFERRED_TYPE(SuppressInlineNamespaceMode)
151+
unsigned SuppressInlineNamespace : 2;
148152

149153
/// Ignore qualifiers and tag keywords as specified by elaborated type sugar,
150154
/// instead letting the underlying type print as normal.

clang/include/clang/Basic/Attr.td

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,11 @@ class TargetSpecificAttr<TargetSpec target> {
759759
/// redeclarations, even when it's written on a parameter.
760760
class InheritableParamAttr : InheritableAttr;
761761

762+
/// A attribute that is either a declaration attribute or a statement attribute,
763+
/// and if used as a declaration attribute, is inherited by later
764+
/// redeclarations, even when it's written on a parameter.
765+
class InheritableParamOrStmtAttr : InheritableParamAttr;
766+
762767
/// An attribute which changes the ABI rules for a specific parameter.
763768
class ParameterABIAttr : InheritableParamAttr {
764769
let Subjects = SubjectList<[ParmVar]>;
@@ -928,7 +933,7 @@ def AnalyzerNoReturn : InheritableAttr {
928933
let Documentation = [Undocumented];
929934
}
930935

931-
def Annotate : InheritableParamAttr {
936+
def Annotate : InheritableParamOrStmtAttr {
932937
let Spellings = [Clang<"annotate">];
933938
let Args = [StringArgument<"Annotation">, VariadicExprArgument<"Args">];
934939
// Ensure that the annotate attribute can be used with

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4745,6 +4745,12 @@ def HLSLCross: LangBuiltin<"HLSL_LANG"> {
47454745
let Prototype = "void(...)";
47464746
}
47474747

4748+
def HLSLDegrees : LangBuiltin<"HLSL_LANG"> {
4749+
let Spellings = ["__builtin_hlsl_elementwise_degrees"];
4750+
let Attributes = [NoThrow, Const];
4751+
let Prototype = "void(...)";
4752+
}
4753+
47484754
def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
47494755
let Spellings = ["__builtin_hlsl_dot"];
47504756
let Attributes = [NoThrow, Const];

0 commit comments

Comments
 (0)