Skip to content

Commit 5073796

Browse files
authored
Merge pull request #513 from Xilinx/bump_to_31249e27
[AutoBump] Merge with 31249e2 (Jan 14) (42)
2 parents 843962e + db1df40 commit 5073796

File tree

421 files changed

+9967
-3724
lines changed

Some content is hidden

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

421 files changed

+9967
-3724
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ Changes in existing checks
351351
<clang-tidy/checks/performance/move-const-arg>` check to fix a crash when
352352
an argument type is declared but not defined.
353353

354-
- Improved :doc:`performance-unnecessary-copy-initialization`
355-
<clang-tidy/checks/performance/unnecessary-copy-initialization> check
354+
- Improved :doc:`performance-unnecessary-copy-initialization
355+
<clang-tidy/checks/performance/unnecessary-copy-initialization>` check
356356
to consider static member functions the same way as free functions.
357357

358358
- Improved :doc:`readability-container-contains

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,15 @@ Arm and AArch64 Support
10761076
in leaf functions after enabling ``-fno-omit-frame-pointer``, you can do so by adding
10771077
the ``-momit-leaf-frame-pointer`` option.
10781078

1079+
- SME keyword attributes which apply to function types are now represented in the
1080+
mangling of the type. This means that ``void foo(void (*f)() __arm_streaming);``
1081+
now has a different mangling from ``void foo(void (*f)());``.
1082+
1083+
- The ``__arm_agnostic`` keyword attribute was added to let users describe
1084+
a function that preserves SME state enabled by PSTATE.ZA without having to share
1085+
this state with its callers and without making the assumption that this state
1086+
exists.
1087+
10791088
- Support has been added for the following processors (-mcpu identifiers in parenthesis):
10801089

10811090
For AArch64:

clang/include/clang/AST/Decl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4285,6 +4285,14 @@ class RecordDecl : public TagDecl {
42854285
RecordDeclBits.HasNonTrivialToPrimitiveCopyCUnion = V;
42864286
}
42874287

4288+
bool hasUninitializedExplicitInitFields() const {
4289+
return RecordDeclBits.HasUninitializedExplicitInitFields;
4290+
}
4291+
4292+
void setHasUninitializedExplicitInitFields(bool V) {
4293+
RecordDeclBits.HasUninitializedExplicitInitFields = V;
4294+
}
4295+
42884296
/// Determine whether this class can be passed in registers. In C++ mode,
42894297
/// it must have at least one trivial, non-deleted copy or move constructor.
42904298
/// FIXME: This should be set as part of completeDefinition.

clang/include/clang/AST/DeclBase.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,9 @@ class DeclContext {
14461446
/// hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups
14471447
friend class ASTWriter;
14481448

1449+
protected:
1450+
enum { NumOdrHashBits = 25 };
1451+
14491452
// We use uint64_t in the bit-fields below since some bit-fields
14501453
// cross the unsigned boundary and this breaks the packing.
14511454

@@ -1667,6 +1670,14 @@ class DeclContext {
16671670
LLVM_PREFERRED_TYPE(bool)
16681671
uint64_t HasNonTrivialToPrimitiveCopyCUnion : 1;
16691672

1673+
/// True if any field is marked as requiring explicit initialization with
1674+
/// [[clang::require_explicit_initialization]].
1675+
/// In C++, this is also set for types without a user-provided default
1676+
/// constructor, and is propagated from any base classes and/or member
1677+
/// variables whose types are aggregates.
1678+
LLVM_PREFERRED_TYPE(bool)
1679+
uint64_t HasUninitializedExplicitInitFields : 1;
1680+
16701681
/// Indicates whether this struct is destroyed in the callee.
16711682
LLVM_PREFERRED_TYPE(bool)
16721683
uint64_t ParamDestroyedInCallee : 1;
@@ -1681,7 +1692,7 @@ class DeclContext {
16811692

16821693
/// True if a valid hash is stored in ODRHash. This should shave off some
16831694
/// extra storage and prevent CXXRecordDecl to store unused bits.
1684-
uint64_t ODRHash : 26;
1695+
uint64_t ODRHash : NumOdrHashBits;
16851696
};
16861697

16871698
/// Number of inherited and non-inherited bits in RecordDeclBitfields.

clang/include/clang/Basic/Attr.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,13 @@ def Leaf : InheritableAttr {
19021902
let SimpleHandler = 1;
19031903
}
19041904

1905+
def ExplicitInit : InheritableAttr {
1906+
let Spellings = [Clang<"require_explicit_initialization">];
1907+
let Subjects = SubjectList<[Field], ErrorDiag>;
1908+
let Documentation = [ExplicitInitDocs];
1909+
let SimpleHandler = 1;
1910+
}
1911+
19051912
def LifetimeBound : DeclOrTypeAttr {
19061913
let Spellings = [Clang<"lifetimebound", 0>];
19071914
let Subjects = SubjectList<[ParmVar, ImplicitObjectParameter], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,55 @@ is not specified.
16841684
}];
16851685
}
16861686

1687+
def ExplicitInitDocs : Documentation {
1688+
let Category = DocCatField;
1689+
let Content = [{
1690+
The ``clang::require_explicit_initialization`` attribute indicates that a
1691+
field of an aggregate must be initialized explicitly by the user when an object
1692+
of the aggregate type is constructed. The attribute supports both C and C++,
1693+
but its usage is invalid on non-aggregates.
1694+
1695+
Note that this attribute is *not* a memory safety feature, and is *not* intended
1696+
to guard against use of uninitialized memory.
1697+
1698+
Rather, it is intended for use in "parameter-objects", used to simulate,
1699+
for example, the passing of named parameters.
1700+
The attribute generates a warning when explicit initializers for such
1701+
variables are not provided (this occurs regardless of whether any in-class field
1702+
initializers exist):
1703+
1704+
.. code-block:: c++
1705+
1706+
struct Buffer {
1707+
void *address [[clang::require_explicit_initialization]];
1708+
size_t length [[clang::require_explicit_initialization]] = 0;
1709+
};
1710+
1711+
struct ArrayIOParams {
1712+
size_t count [[clang::require_explicit_initialization]];
1713+
size_t element_size [[clang::require_explicit_initialization]];
1714+
int flags = 0;
1715+
};
1716+
1717+
size_t ReadArray(FILE *file, struct Buffer buffer,
1718+
struct ArrayIOParams params);
1719+
1720+
int main() {
1721+
unsigned int buf[512];
1722+
ReadArray(stdin, {
1723+
buf
1724+
// warning: field 'length' is not explicitly initialized
1725+
}, {
1726+
.count = sizeof(buf) / sizeof(*buf),
1727+
// warning: field 'element_size' is not explicitly initialized
1728+
// (Note that a missing initializer for 'flags' is not diagnosed, because
1729+
// the field is not marked as requiring explicit initialization.)
1730+
});
1731+
}
1732+
1733+
}];
1734+
}
1735+
16871736
def NoUniqueAddressDocs : Documentation {
16881737
let Category = DocCatField;
16891738
let Content = [{

clang/include/clang/Basic/BuiltinsHexagonDep.def

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,3 +1923,48 @@ TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_sf_bf_acc, "V32iV32iV16iV16i", "", HVXV
19231923
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_sf_bf_acc_128B, "V64iV64iV32iV32i", "", HVXV73)
19241924
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_sf_bf, "V32iV16iV16i", "", HVXV73)
19251925
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_sf_bf_128B, "V64iV32iV32i", "", HVXV73)
1926+
1927+
// V79 HVX Instructions.
1928+
1929+
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext, "V16iV16ii", "", HVXV79)
1930+
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_128B, "V32iV32ii", "", HVXV79)
1931+
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_oracc, "V16iV16iV16ii", "", HVXV79)
1932+
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_oracc_128B, "V32iV32iV32ii", "", HVXV79)
1933+
TARGET_BUILTIN(__builtin_HEXAGON_V6_set_qfext, "V16iV16ii", "", HVXV79)
1934+
TARGET_BUILTIN(__builtin_HEXAGON_V6_set_qfext_128B, "V32iV32ii", "", HVXV79)
1935+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vabs_f8, "V16iV16i", "", HVXV79)
1936+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vabs_f8_128B, "V32iV32i", "", HVXV79)
1937+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vadd_hf_f8, "V32iV16iV16i", "", HVXV79)
1938+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vadd_hf_f8_128B, "V64iV32iV32i", "", HVXV79)
1939+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_b_hf, "V16iV16iV16i", "", HVXV79)
1940+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_b_hf_128B, "V32iV32iV32i", "", HVXV79)
1941+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_b, "V32iV16i", "", HVXV79)
1942+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_b_128B, "V64iV32i", "", HVXV79)
1943+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_ub, "V32iV16i", "", HVXV79)
1944+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_ub_128B, "V64iV32i", "", HVXV79)
1945+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_ub_hf, "V16iV16iV16i", "", HVXV79)
1946+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_ub_hf_128B, "V32iV32iV32i", "", HVXV79)
1947+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_f8_hf, "V16iV16iV16i", "", HVXV79)
1948+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_f8_hf_128B, "V32iV32iV32i", "", HVXV79)
1949+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_hf_f8, "V32iV16i", "", HVXV79)
1950+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_hf_f8_128B, "V64iV32i", "", HVXV79)
1951+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmax_f8, "V16iV16iV16i", "", HVXV79)
1952+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmax_f8_128B, "V32iV32iV32i", "", HVXV79)
1953+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmin_f8, "V16iV16iV16i", "", HVXV79)
1954+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmin_f8_128B, "V32iV32iV32i", "", HVXV79)
1955+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfneg_f8, "V16iV16i", "", HVXV79)
1956+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfneg_f8_128B, "V32iV32i", "", HVXV79)
1957+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmerge_qf, "V16iV16iV16i", "", HVXV79)
1958+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmerge_qf_128B, "V32iV32iV32i", "", HVXV79)
1959+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8, "V32iV16iV16i", "", HVXV79)
1960+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_128B, "V64iV32iV32i", "", HVXV79)
1961+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_acc, "V32iV32iV16iV16i", "", HVXV79)
1962+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_acc_128B, "V64iV64iV32iV32i", "", HVXV79)
1963+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_hf, "V16iV16ii", "", HVXV79)
1964+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_hf_128B, "V32iV32ii", "", HVXV79)
1965+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_qf16, "V16iV16ii", "", HVXV79)
1966+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_qf16_128B, "V32iV32ii", "", HVXV79)
1967+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_sf, "V16iV16ii", "", HVXV79)
1968+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_sf_128B, "V32iV32ii", "", HVXV79)
1969+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_hf_f8, "V32iV16iV16i", "", HVXV79)
1970+
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_hf_f8_128B, "V64iV32iV32i", "", HVXV79)

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ def note_constexpr_assumption_failed : Note<
396396
def err_experimental_clang_interp_failed : Error<
397397
"the experimental clang interpreter failed to evaluate an expression">;
398398

399+
def warn_attribute_needs_aggregate : Warning<
400+
"%0 attribute is ignored in non-aggregate type %1">,
401+
InGroup<IgnoredAttributes>;
402+
403+
def warn_cxx20_compat_requires_explicit_init_non_aggregate : Warning<
404+
"explicit initialization of field %1 will not be enforced in C++20 and later "
405+
"because %2 has a user-declared constructor, making the type no longer an "
406+
"aggregate">,
407+
DefaultIgnore, InGroup<CXX20Compat>;
408+
399409
def warn_integer_constant_overflow : Warning<
400410
"overflow in expression; result is %0 with type %1">,
401411
InGroup<DiagGroup<"integer-overflow">>;

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ def Trigraphs : DiagGroup<"trigraphs">;
796796
def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
797797
def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
798798
def Unicode : DiagGroup<"unicode">;
799+
def UninitializedExplicitInit : DiagGroup<"uninitialized-explicit-init">;
799800
def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
800801
def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
801802
def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,9 @@ def err_init_reference_member_uninitialized : Error<
23472347
"reference member of type %0 uninitialized">;
23482348
def note_uninit_reference_member : Note<
23492349
"uninitialized reference member is here">;
2350+
def warn_field_requires_explicit_init : Warning<
2351+
"field %select{%1|in %1}0 requires explicit initialization but is not "
2352+
"explicitly initialized">, InGroup<UninitializedExplicitInit>;
23502353
def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
23512354
InGroup<Uninitialized>;
23522355
def warn_base_class_is_uninit : Warning<

0 commit comments

Comments
 (0)