Skip to content

Commit cc2a236

Browse files
authored
Merge pull request #454 from Xilinx/bump_to_8a9921f5
[AutoBump] Merge with 8a9921f (Oct 23) (17)
2 parents dc1a1db + 3f5d12c commit cc2a236

File tree

355 files changed

+13325
-9478
lines changed

Some content is hidden

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

355 files changed

+13325
-9478
lines changed

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {
2323

2424
void ProTypeUnionAccessCheck::check(const MatchFinder::MatchResult &Result) {
2525
const auto *Matched = Result.Nodes.getNodeAs<MemberExpr>("expr");
26-
diag(Matched->getMemberLoc(),
27-
"do not access members of unions; use (boost::)variant instead");
26+
SourceLocation Loc = Matched->getMemberLoc();
27+
if (Loc.isInvalid())
28+
Loc = Matched->getBeginLoc();
29+
diag(Loc, "do not access members of unions; consider using (boost::)variant "
30+
"instead");
2831
}
2932

3033
} // namespace clang::tidy::cppcoreguidelines

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ Changes in existing checks
180180
avoid false positive when member initialization depends on a structured
181181
binding variable.
182182

183+
- Fixed :doc:`cppcoreguidelines-pro-type-union-access
184+
<clang-tidy/checks/cppcoreguidelines/pro-type-union-access>` check to
185+
report a location even when the member location is not valid.
186+
183187
- Improved :doc:`misc-definitions-in-headers
184188
<clang-tidy/checks/misc/definitions-in-headers>` check by rewording the
185189
diagnostic note that suggests adding ``inline``.

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-type-union-access.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ union U {
55
char union_member2;
66
} u;
77

8+
union W {
9+
template <class TP> operator TP *() const;
10+
};
11+
812
struct S {
913
int non_union_member;
1014
union {
@@ -20,22 +24,25 @@ void f(char);
2024
void f2(U);
2125
void f3(U&);
2226
void f4(U*);
27+
W f5();
2328

2429
void check()
2530
{
2631
u.union_member1 = true;
27-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
32+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not access members of unions; consider using (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
2833
auto b = u.union_member2;
29-
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: do not access members of unions; use (boost::)variant instead
34+
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: do not access members of unions; consider using (boost::)variant instead
3035
auto a = &s.union_member;
31-
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; use (boost::)variant instead
36+
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; consider using (boost::)variant instead
3237
f(s.u.union_member2);
33-
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: do not access members of unions; use (boost::)variant instead
38+
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: do not access members of unions; consider using (boost::)variant instead
3439

3540
s.non_union_member = 2; // OK
3641

3742
U u2 = u; // OK
3843
f2(u); // OK
3944
f3(u); // OK
4045
f4(&u); // OK
46+
void *ret = f5();
47+
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; consider using (boost::)variant instead
4148
}

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ Bug Fixes in This Version
442442
- Fixed a crash using ``__array_rank`` on 64-bit targets. (#GH113044).
443443
- The warning emitted for an unsupported register variable type now points to
444444
the unsupported type instead of the ``register`` keyword (#GH109776).
445+
- Fixed a crash when emit ctor for global variant with flexible array init (#GH113187).
445446

446447
Bug Fixes to Compiler Builtins
447448
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/Type.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,8 +2661,10 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26612661
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) bool is##Id##Type() const;
26622662
#include "clang/Basic/HLSLIntangibleTypes.def"
26632663
bool isHLSLSpecificType() const; // Any HLSL specific type
2664-
bool isHLSLIntangibleType() const; // Any HLSL intangible type
2664+
bool isHLSLBuiltinIntangibleType() const; // Any HLSL builtin intangible type
26652665
bool isHLSLAttributedResourceType() const;
2666+
bool isHLSLIntangibleType()
2667+
const; // Any HLSL intangible type (builtin, array, class)
26662668

26672669
/// Determines if this type, which must satisfy
26682670
/// isObjCLifetimeType(), is implicitly __unsafe_unretained rather
@@ -8450,15 +8452,15 @@ inline bool Type::isOpenCLSpecificType() const {
84508452
}
84518453
#include "clang/Basic/HLSLIntangibleTypes.def"
84528454

8453-
inline bool Type::isHLSLIntangibleType() const {
8455+
inline bool Type::isHLSLBuiltinIntangibleType() const {
84548456
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) is##Id##Type() ||
84558457
return
84568458
#include "clang/Basic/HLSLIntangibleTypes.def"
8457-
isHLSLAttributedResourceType();
8459+
false;
84588460
}
84598461

84608462
inline bool Type::isHLSLSpecificType() const {
8461-
return isHLSLIntangibleType() || isa<HLSLAttributedResourceType>(this);
8463+
return isHLSLBuiltinIntangibleType() || isHLSLAttributedResourceType();
84628464
}
84638465

84648466
inline bool Type::isHLSLAttributedResourceType() const {

clang/include/clang/Basic/AArch64SVEACLETypes.def

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@
9797
SVE_TYPE(Name, Id, SingletonId)
9898
#endif
9999

100+
#ifndef AARCH64_VECTOR_TYPE
101+
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
102+
SVE_TYPE(Name, Id, SingletonId)
103+
#endif
104+
105+
#ifndef AARCH64_VECTOR_TYPE_MFLOAT
106+
#define AARCH64_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF) \
107+
AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId)
108+
#endif
109+
110+
100111
//===- Vector point types -----------------------------------------------===//
101112

102113
SVE_VECTOR_TYPE_INT("__SVInt8_t", "__SVInt8_t", SveInt8, SveInt8Ty, 16, 8, 1, true)
@@ -190,11 +201,16 @@ SVE_PREDICATE_TYPE_ALL("__clang_svboolx4_t", "svboolx4_t", SveBoolx4, SveBoolx4T
190201

191202
SVE_OPAQUE_TYPE("__SVCount_t", "__SVCount_t", SveCount, SveCountTy)
192203

204+
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x8_t", "__MFloat8x8_t", MFloat8x8, MFloat8x8Ty, 8, 8, 1)
205+
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x16_t", "__MFloat8x16_t", MFloat8x16, MFloat8x16Ty, 16, 8, 1)
206+
193207
#undef SVE_VECTOR_TYPE
194208
#undef SVE_VECTOR_TYPE_BFLOAT
195209
#undef SVE_VECTOR_TYPE_FLOAT
196210
#undef SVE_VECTOR_TYPE_INT
197211
#undef SVE_PREDICATE_TYPE
198212
#undef SVE_PREDICATE_TYPE_ALL
199213
#undef SVE_OPAQUE_TYPE
214+
#undef AARCH64_VECTOR_TYPE_MFLOAT
215+
#undef AARCH64_VECTOR_TYPE
200216
#undef SVE_TYPE

clang/include/clang/Basic/Cuda.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ enum class OffloadArch {
127127
GFX1150,
128128
GFX1151,
129129
GFX1152,
130+
GFX1153,
130131
GFX12_GENERIC,
131132
GFX1200,
132133
GFX1201,

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ def err_sls_hardening_arm_not_supported : Error<
502502
def warn_drv_large_data_threshold_invalid_code_model: Warning<
503503
"'%0' only applies to medium and large code models">,
504504
InGroup<UnusedCommandLineArgument>;
505+
def warn_drv_math_errno_enabled_after_veclib: Warning<
506+
"math errno enabled by '%0' after it was implicitly disabled by '%1',"
507+
" this may limit the utilization of the vector library">,
508+
InGroup<MathErrnoEnabledWithVecLib>;
505509

506510
def note_drv_command_failed_diag_msg : Note<
507511
"diagnostic msg: %0">;

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def FloatZeroConversion : DiagGroup<"float-zero-conversion">;
125125
def FloatConversion :
126126
DiagGroup<"float-conversion", [FloatOverflowConversion,
127127
FloatZeroConversion]>;
128+
def MathErrnoEnabledWithVecLib : DiagGroup<"math-errno-enabled-with-veclib">;
128129

129130
def FrameAddress : DiagGroup<"frame-address">;
130131
def FreeNonHeapObject : DiagGroup<"free-nonheap-object">;

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,6 +3411,9 @@ def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_
34113411
def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
34123412
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
34133413
HelpText<"Use the given vector functions library">,
3414+
HelpTextForVariants<[ClangOption, CC1Option],
3415+
"Use the given vector functions library. "
3416+
"Note: -fveclib={ArmPL,SLEEF} implies -fno-math-errno">,
34143417
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,AMDLIBM,none">,
34153418
NormalizedValuesScope<"llvm::driver::VectorLibrary">,
34163419
NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
@@ -5394,6 +5397,10 @@ def mfrecipe : Flag<["-"], "mfrecipe">, Group<m_loongarch_Features_Group>,
53945397
HelpText<"Enable frecipe.{s/d} and frsqrte.{s/d}">;
53955398
def mno_frecipe : Flag<["-"], "mno-frecipe">, Group<m_loongarch_Features_Group>,
53965399
HelpText<"Disable frecipe.{s/d} and frsqrte.{s/d}">;
5400+
def mlam_bh : Flag<["-"], "mlam-bh">, Group<m_loongarch_Features_Group>,
5401+
HelpText<"Enable amswap_[db].{b/h} and amadd_[db].{b/h}">;
5402+
def mno_lam_bh : Flag<["-"], "mno-lam-bh">, Group<m_loongarch_Features_Group>,
5403+
HelpText<"Disable amswap_[db].{b/h} and amadd_[db].{b/h}">;
53975404
def mannotate_tablejump : Flag<["-"], "mannotate-tablejump">, Group<m_loongarch_Features_Group>,
53985405
HelpText<"Enable annotate table jump instruction to correlate it with the jump table.">;
53995406
def mno_annotate_tablejump : Flag<["-"], "mno-annotate-tablejump">, Group<m_loongarch_Features_Group>,

0 commit comments

Comments
 (0)