Skip to content

Commit 12b35d4

Browse files
committed
merge main into amd-staging
2 parents 18e6036 + 1442fe0 commit 12b35d4

File tree

867 files changed

+53360
-117881
lines changed

Some content is hidden

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

867 files changed

+53360
-117881
lines changed

.ci/metrics/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# This means we essentially have a list of workflows sorted by creation date,
4444
# and that's all we can deduce from it. So for each iteration, we'll blindly
4545
# process the last N workflows.
46-
GITHUB_WORKFLOWS_MAX_PROCESS_COUNT = 1000
46+
GITHUB_WORKFLOWS_MAX_PROCESS_COUNT = 2000
4747
# Second reason for the cut: reaching a workflow older than X.
4848
# This means we will miss long-tails (exceptional jobs running for more than
4949
# X hours), but that's also the case with the count cutoff above.

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
244244
Inst.clear();
245245
Inst.addOperand(MCOperand::createExpr(RISCVMCExpr::create(
246246
MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx),
247-
RISCVMCExpr::VK_RISCV_CALL, *Ctx)));
247+
RISCVMCExpr::VK_CALL, *Ctx)));
248248
}
249249

250250
void createCall(MCInst &Inst, const MCSymbol *Target,
@@ -434,19 +434,19 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
434434
case ELF::R_RISCV_TLS_GOT_HI20:
435435
// The GOT is reused so no need to create GOT relocations
436436
case ELF::R_RISCV_PCREL_HI20:
437-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_PCREL_HI, Ctx);
437+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_HI, Ctx);
438438
case ELF::R_RISCV_PCREL_LO12_I:
439439
case ELF::R_RISCV_PCREL_LO12_S:
440-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_PCREL_LO, Ctx);
440+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_LO, Ctx);
441441
case ELF::R_RISCV_HI20:
442-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_HI, Ctx);
442+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_HI, Ctx);
443443
case ELF::R_RISCV_LO12_I:
444444
case ELF::R_RISCV_LO12_S:
445-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_LO, Ctx);
445+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_LO, Ctx);
446446
case ELF::R_RISCV_CALL:
447-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_CALL, Ctx);
447+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL, Ctx);
448448
case ELF::R_RISCV_CALL_PLT:
449-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_RISCV_CALL_PLT, Ctx);
449+
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL_PLT, Ctx);
450450
}
451451
}
452452

@@ -471,8 +471,8 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
471471
switch (cast<RISCVMCExpr>(ImmExpr)->getKind()) {
472472
default:
473473
return false;
474-
case RISCVMCExpr::VK_RISCV_CALL:
475-
case RISCVMCExpr::VK_RISCV_CALL_PLT:
474+
case RISCVMCExpr::VK_CALL:
475+
case RISCVMCExpr::VK_CALL_PLT:
476476
return true;
477477
}
478478
}

clang/docs/ClangOffloadBundler.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,14 @@ without differentiation based on offload kind.
266266
The target triple of the code object. See `Target Triple
267267
<https://clang.llvm.org/docs/CrossCompilation.html#target-triple>`_.
268268

269-
The bundler accepts target triples with or without the optional environment
270-
field:
269+
LLVM target triples can be with or without the optional environment field:
271270

272271
``<arch><sub>-<vendor>-<sys>``, or
273272
``<arch><sub>-<vendor>-<sys>-<env>``
274273

275-
However, in order to standardize outputs for tools that consume bitcode
276-
bundles, bundles written by the bundler internally use only the 4-field
277-
target triple:
274+
However, in order to standardize outputs for tools that consume bitcode bundles
275+
and to parse target ID containing dashes, the bundler only accepts target
276+
triples in the 4-field format:
278277

279278
``<arch><sub>-<vendor>-<sys>-<env>``
280279

@@ -543,4 +542,4 @@ The compressed offload bundle begins with a header followed by the compressed bi
543542
- **Compressed Data**:
544543
The actual compressed binary data follows the header. Its size can be inferred from the total size of the file minus the header size.
545544

546-
> **Note**: Version 3 of the format is under development. It uses 64-bit fields for Total File Size and Uncompressed Binary Size to support files larger than 4GB. To experiment with version 3, set the environment variable `COMPRESSED_BUNDLE_FORMAT_VERSION=3`. This support is experimental and not recommended for production use.
545+
> **Note**: Version 3 of the format is under development. It uses 64-bit fields for Total File Size and Uncompressed Binary Size to support files larger than 4GB. To experiment with version 3, set the environment variable `COMPRESSED_BUNDLE_FORMAT_VERSION=3`. This support is experimental and not recommended for production use.

clang/docs/LanguageExtensions.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,7 @@ Designated initializers (N494) C
16521652
Array & element qualification (N2607) C23 C89
16531653
Attributes (N2335) C23 C89
16541654
``#embed`` (N3017) C23 C89, C++
1655+
Octal literals prefixed with ``0o`` or ``0O`` C2y C89, C++
16551656
============================================= ================================ ============= =============
16561657

16571658
Builtin type aliases
@@ -1911,6 +1912,40 @@ A simplistic usage example as might be seen in standard C++ headers follows:
19111912
// Emulate type trait for compatibility with other compilers.
19121913
#endif
19131914

1915+
1916+
.. _builtin_structured_binding_size-doc:
1917+
1918+
__builtin_structured_binding_size (C++)
1919+
---------------------------------------
1920+
1921+
The ``__builtin_structured_binding_size(T)`` type trait returns
1922+
the *structured binding size* ([dcl.struct.bind]) of type ``T``
1923+
1924+
This is equivalent to the size of the pack ``p`` in ``auto&& [...p] = declval<T&>();``.
1925+
If the argument cannot be decomposed, ``__builtin_structured_binding_size(T)``
1926+
is not a valid expression (``__builtin_structured_binding_size`` is SFINAE-friendly).
1927+
1928+
builtin arrays, builtin SIMD vectors,
1929+
builtin complex types, *tuple-like* types, and decomposable class types
1930+
are decomposable types.
1931+
1932+
A type is considered a valid *tuple-like* if ``std::tuple_size_v<T>`` is a valid expression,
1933+
even if there is no valid ``std::tuple_element`` specialization or suitable
1934+
``get`` function for that type.
1935+
1936+
.. code-block:: c++
1937+
1938+
template<std::size_t Idx, typename T>
1939+
requires (Idx < __builtin_structured_binding_size(T))
1940+
decltype(auto) constexpr get_binding(T&& obj) {
1941+
auto && [...p] = std::forward<T>(obj);
1942+
return p...[Idx];
1943+
}
1944+
struct S { int a = 0, b = 42; };
1945+
static_assert(__builtin_structured_binding_size(S) == 2);
1946+
static_assert(get_binding<1>(S{}) == 42);
1947+
1948+
19141949
Blocks
19151950
======
19161951

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ What's New in Clang |release|?
7474
C++ Language Changes
7575
--------------------
7676

77+
- Added a :ref:`__builtin_structured_binding_size <builtin_structured_binding_size-doc>` (T)
78+
builtin that returns the number of structured bindings that would be produced by destructuring ``T``.
79+
7780
- Similarly to GCC, Clang now supports constant expressions in
7881
the strings of a GNU ``asm`` statement.
7982

@@ -129,6 +132,13 @@ C2y Feature Support
129132
- Implemented `WG14 N3411 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3411.pdf>`_
130133
which allows a source file to not end with a newline character. This is still
131134
reported as a conforming extension in earlier language modes.
135+
- Implemented `WG14 N3353 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm>_`
136+
which adds the new ``0o`` and ``0O`` ocal literal prefixes and deprecates
137+
octal literals other than ``0`` which do not start with the new prefix. This
138+
feature is exposed in earlier language modes and in C++ as an extension. The
139+
paper also introduced octal and hexadecimal delimited escape sequences (e.g.,
140+
``"\x{12}\o{12}"``) which are also supported as an extension in older C
141+
language modes.
132142

133143
C23 Feature Support
134144
^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/ExprCXX.h

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <cstdint>
5252
#include <memory>
5353
#include <optional>
54+
#include <variant>
5455

5556
namespace clang {
5657

@@ -2765,27 +2766,27 @@ class CXXPseudoDestructorExpr : public Expr {
27652766
/// \endcode
27662767
class TypeTraitExpr final
27672768
: public Expr,
2768-
private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> {
2769+
private llvm::TrailingObjects<TypeTraitExpr, APValue, TypeSourceInfo *> {
27692770
/// The location of the type trait keyword.
27702771
SourceLocation Loc;
27712772

27722773
/// The location of the closing parenthesis.
27732774
SourceLocation RParenLoc;
27742775

2775-
// Note: The TypeSourceInfos for the arguments are allocated after the
2776-
// TypeTraitExpr.
2777-
27782776
TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind,
2779-
ArrayRef<TypeSourceInfo *> Args,
2780-
SourceLocation RParenLoc,
2781-
bool Value);
2777+
ArrayRef<TypeSourceInfo *> Args, SourceLocation RParenLoc,
2778+
std::variant<bool, APValue> Value);
27822779

27832780
TypeTraitExpr(EmptyShell Empty) : Expr(TypeTraitExprClass, Empty) {}
27842781

27852782
size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>) const {
27862783
return getNumArgs();
27872784
}
27882785

2786+
size_t numTrailingObjects(OverloadToken<APValue>) const {
2787+
return TypeTraitExprBits.IsBooleanTypeTrait ? 0 : 1;
2788+
}
2789+
27892790
public:
27902791
friend class ASTStmtReader;
27912792
friend class ASTStmtWriter;
@@ -2798,19 +2799,34 @@ class TypeTraitExpr final
27982799
SourceLocation RParenLoc,
27992800
bool Value);
28002801

2802+
static TypeTraitExpr *Create(const ASTContext &C, QualType T,
2803+
SourceLocation Loc, TypeTrait Kind,
2804+
ArrayRef<TypeSourceInfo *> Args,
2805+
SourceLocation RParenLoc, APValue Value);
2806+
28012807
static TypeTraitExpr *CreateDeserialized(const ASTContext &C,
2808+
bool IsStoredAsBool,
28022809
unsigned NumArgs);
28032810

28042811
/// Determine which type trait this expression uses.
28052812
TypeTrait getTrait() const {
28062813
return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
28072814
}
28082815

2809-
bool getValue() const {
2810-
assert(!isValueDependent());
2816+
bool isStoredAsBoolean() const {
2817+
return TypeTraitExprBits.IsBooleanTypeTrait;
2818+
}
2819+
2820+
bool getBoolValue() const {
2821+
assert(!isValueDependent() && TypeTraitExprBits.IsBooleanTypeTrait);
28112822
return TypeTraitExprBits.Value;
28122823
}
28132824

2825+
const APValue &getAPValue() const {
2826+
assert(!isValueDependent() && !TypeTraitExprBits.IsBooleanTypeTrait);
2827+
return *getTrailingObjects<APValue>();
2828+
}
2829+
28142830
/// Determine the number of arguments to this type trait.
28152831
unsigned getNumArgs() const { return TypeTraitExprBits.NumArgs; }
28162832

clang/include/clang/AST/Stmt.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,13 @@ class alignas(void *) Stmt {
954954
LLVM_PREFERRED_TYPE(TypeTrait)
955955
unsigned Kind : 8;
956956

957-
/// If this expression is not value-dependent, this indicates whether
958-
/// the trait evaluated true or false.
959957
LLVM_PREFERRED_TYPE(bool)
960-
unsigned Value : 1;
958+
unsigned IsBooleanTypeTrait : 1;
961959

960+
/// If this expression is a non value-dependent boolean trait,
961+
/// this indicates whether the trait evaluated true or false.
962+
LLVM_PREFERRED_TYPE(bool)
963+
unsigned Value : 1;
962964
/// The number of arguments to this type trait. According to [implimits]
963965
/// 8 bits would be enough, but we require (and test for) at least 16 bits
964966
/// to mirror FunctionType.

clang/include/clang/Analysis/ProgramPoint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class ProgramPointTag {
3939
public:
4040
ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {}
4141
virtual ~ProgramPointTag();
42+
43+
/// The description of this program point which will be displayed when the
44+
/// ExplodedGraph is dumped in DOT format for debugging.
4245
virtual StringRef getTagDescription() const = 0;
4346

4447
/// Used to implement 'isKind' in subclasses.

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def EnumCompare : DiagGroup<"enum-compare", [EnumCompareSwitch,
9292
def DeprecatedAnonEnumEnumConversion : DiagGroup<"deprecated-anon-enum-enum-conversion">;
9393
def DeprecatedEnumEnumConversion : DiagGroup<"deprecated-enum-enum-conversion">;
9494
def DeprecatedEnumFloatConversion : DiagGroup<"deprecated-enum-float-conversion">;
95+
def DeprecatedOctalLiterals : DiagGroup<"deprecated-octal-literals">;
9596
def AnonEnumEnumConversion : DiagGroup<"anon-enum-enum-conversion",
9697
[DeprecatedAnonEnumEnumConversion]>;
9798
def EnumEnumConversion : DiagGroup<"enum-enum-conversion",
@@ -235,7 +236,8 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAnonEnumEnumConversion,
235236
DeprecatedVolatile,
236237
DeprecatedWritableStr,
237238
DeprecatedRedundantConstexprStaticDef,
238-
DeprecatedMissingCommaVariadicParam
239+
DeprecatedMissingCommaVariadicParam,
240+
DeprecatedOctalLiterals
239241
]>,
240242
DiagCategory<"Deprecations">;
241243

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ def ext_mathematical_notation : ExtWarn<
148148
InGroup<DiagGroup<"mathematical-notation-identifier-extension">>;
149149

150150
def ext_delimited_escape_sequence : Extension<
151-
"%select{delimited|named}0 escape sequences are a "
152-
"%select{Clang|C++23}1 extension">,
153-
InGroup<DiagGroup<"delimited-escape-sequence-extension">>;
154-
151+
"%select{delimited|named}0 escape sequences are a %select{C++23|C2y|Clang}1 "
152+
"extension">, InGroup<DiagGroup<"delimited-escape-sequence-extension">>;
155153
def warn_cxx23_delimited_escape_sequence : Warning<
156-
"%select{delimited|named}0 escape sequences are "
157-
"incompatible with C++ standards before C++23">,
158-
InGroup<CXXPre23Compat>, DefaultIgnore;
154+
"%select{delimited|named}0 escape sequences are incompatible with C++ "
155+
"standards before C++23">, InGroup<CXXPre23Compat>, DefaultIgnore;
156+
def warn_c2y_delimited_escape_sequence : Warning<
157+
"delimited escape sequences are incompatible with C standards before C2y">,
158+
InGroup<CPre2yCompat>, DefaultIgnore;
159159

160160
def err_delimited_escape_empty : Error<
161161
"delimited escape sequence cannot be empty">;
@@ -256,6 +256,17 @@ def warn_cxx17_hex_literal : Warning<
256256
"hexadecimal floating literals are incompatible with "
257257
"C++ standards before C++17">,
258258
InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
259+
def ext_octal_literal : Extension<
260+
"octal integer literals are a C2y extension">, InGroup<C2y>;
261+
def ext_cpp_octal_literal : Extension<
262+
"octal integer literals are a Clang extension">,
263+
InGroup<DiagGroup<"octal-prefix-extension">>;
264+
def warn_c2y_compat_octal_literal : Warning<
265+
"octal integer literals are incompatible with standards before C2y">,
266+
InGroup<CPre2yCompat>, DefaultIgnore;
267+
def warn_unprefixed_octal_deprecated : Warning<
268+
"octal literals without a '0o' prefix are deprecated">,
269+
InGroup<DeprecatedOctalLiterals>;
259270
def ext_binary_literal : Extension<
260271
"binary integer literals are a C23 extension">, InGroup<C23>;
261272
def warn_c23_compat_binary_literal : Warning<

0 commit comments

Comments
 (0)