Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoBump] Merge with 8a9921f5 (Oct 23) (17) #454

Open
wants to merge 69 commits into
base: bump_to_519eef3b
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d985197
[NFC][Fuzzer] Refactor to avoid a false warning from gcc (#112944)
jsji Oct 22, 2024
0ffa29f
[clang][modules] Timestamp PCM files when writing (#112452)
jansvoboda11 Oct 22, 2024
fe480cf
[ARM] Use proper types for these records. (#113370)
jofrn Oct 22, 2024
2e0506f
[NFC] [MTE] Remove useless yaml2obj from test (#113374)
fmayer Oct 22, 2024
b4fcaa1
[PGO][SampledInstr] Correct off by 1s and allow 100% sampling (#113350)
mofarrell Oct 22, 2024
8a12e01
Revert "[LLVM] Add IRNormalizer Pass" (#113392)
justinfargnoli Oct 22, 2024
10f0c1a
[PGO] Ensure non-zero entry-count after `populateCounters` (#112029)
mofarrell Oct 22, 2024
4334f31
[TBAA] Extend pointer TBAA to pointers of non-builtin types. (#110569)
fhahn Oct 22, 2024
9b98455
[HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it ac…
hekota Oct 22, 2024
4c1b1f6
[NVPTX] Add support for clamped funnel shift intrinsics (#113228)
AlexMaclean Oct 22, 2024
8234f8a
[DebugInfo] Emit linkage name into DWARF for types for Swift (#112802)
augusto2112 Oct 22, 2024
0fbf91a
[clang-tidy] Fix cppcoreguidelines-pro-type-union-access if memLoc is…
ksromanov Oct 23, 2024
bd6c430
[clang codegen] avoid to crash when emit init func for global variabl…
HerrCai0907 Oct 23, 2024
645e6f1
[llvm][OpenMP] Handle complex types in atomic read (#111377)
NimishMishra Oct 23, 2024
b69ac31
[clang-format] Use RemoveEmptyLinesInUnwrappedLines in clang-format s…
owenca Oct 23, 2024
d005be3
[clang-format] Handle C# `goto case` constructs (#113257)
owenca Oct 23, 2024
9e3d465
[X86] Update Model value for Arrow Lake. (#113273)
FreddyLeaf Oct 23, 2024
49ebe32
[X86] combineAndNotOrIntoAndNotAnd - don't fold other constant operan…
Saldivarcher Oct 23, 2024
1cbc015
[flang][OpenMP] Error out when CHARACTER type is used in atomic const…
NimishMishra Oct 23, 2024
2a25200
[mlir][tensor] Restrict the verifier for tensor.pack/tensor.unpack (#…
banach-space Oct 23, 2024
3b9526b
[TOSA] bug fix infer shape for slice (#108306)
Tai78641 Oct 23, 2024
b39760c
[flang][NFC] Fix failing atomic tests
NimishMishra Oct 23, 2024
ddbb382
[LV] Regenerate check-lines for some tests.
fhahn Oct 23, 2024
8ad8db9
Revert "[TOSA] bug fix infer shape for slice" (#113413)
GeorgeARM Oct 23, 2024
20c5983
[Bazel][SystemZ] Update for #112975
chapuni Oct 23, 2024
46ad7ff
[clang][bytecode] Diagnose non-const initialiers in diagnoseUnknownDe…
tbaederr Oct 23, 2024
076aac5
[AMDGPU] Add a new target for gfx1153 (#113138)
perlfu Oct 23, 2024
076d3e2
[mlir][ods] Verify access to operands in inferReturnTypes (#112574)
npanchen Oct 23, 2024
2c3d7d5
[libc++] <experimental/simd> Add unary operators for class simd (#104…
joy2myself Oct 23, 2024
affb2b7
[LoongArch][MC] Handle more PseudoLA* instructions with la-global-wit…
wangleiat Oct 23, 2024
deb22fa
[ADT] Fix ArrayRef<T>::slice (#113048)
FLZ101 Oct 23, 2024
9afcdaa
[MCParser] De-capitalize ELFAsmParser functions. NFC
MaskRay Oct 23, 2024
100720c
[libc] Use `if constexpr` for compile-time conditionals (#113417)
frobtech Oct 23, 2024
848bc1c
Fix GetRandom in sanitizer_fuchsia.cpp (#110155)
mvanotti Oct 23, 2024
0cb80c4
[AMDGPU] Avoid repeated hash lookups (NFC) (#113409)
kazutakahirata Oct 23, 2024
b799cc3
[RISCV] Add lowering for @llvm.experimental.vector.compress (#113291)
wangpc-pp Oct 23, 2024
ae618d3
[MC] Remove unused getMemtagRelocsSection
MaskRay Oct 23, 2024
5b9c76b
[LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_d…
tangaac Oct 23, 2024
c6931c2
[FuncSpec] Only compute Latency bonus when necessary (#113159)
hazzlim Oct 23, 2024
dd76d9b
[llvm][ARM] Correct the properties of trap instructions (#113287)
DavidSpickett Oct 23, 2024
6eb93d0
[RISCV][MC] Support imm symbol in parseCSRSystemRegister (#112007)
zqb-all Oct 23, 2024
684c26c
[analyzer] Remove redundant "returned to caller" suffix for compound …
z1nke Oct 23, 2024
27158ed
[MLIR][SPIRV] Update cast from IntN to Bool (#113329)
d-smirnov Oct 23, 2024
ad70f3e
[flang][OpenMP] Support `target enter|update|exit .. nowait` (#113305)
ergawy Oct 23, 2024
dfc4065
[llvm][docs] Clean up the "Landing Your Change" section of the GitHub…
DavidSpickett Oct 23, 2024
ac5a201
[PS5][Driver] Pass default -z options to PS5 linker (#113162)
playstation-edd Oct 23, 2024
d89c1db
[flang][hlfir] refine hlfir.assign side effects (#113319)
jeanPerier Oct 23, 2024
03cef62
[flang][NFC] turn (h)fir.declare side effect into debug ressource all…
jeanPerier Oct 23, 2024
a59f712
[flang][hlfir] do not consider local temps as conflicting in assignme…
jeanPerier Oct 23, 2024
2c5208a
[LLVM][AARCH64] Add assembly/disassembly of zeroing convert instructi…
Lukacma Oct 23, 2024
9b88792
[LLD][COFF] Allow overriding EC alias symbols with lazy archive symbo…
cjacek Oct 23, 2024
7ab6d39
[LLVM][CMake][MSVC] Wrap linker flags for ICX on Windows (#112680)
Maetveis Oct 23, 2024
98bc529
[LLD][COFF] Check both mangled and demangled symbols before adding a …
cjacek Oct 23, 2024
699ce16
[lldb] Fix crash missing MSInheritanceAttr with DWARF on Windows (#11…
weliveindetail Oct 23, 2024
c4c60c0
[CodeGen][NewPM] Port OptimizePHIs to NPM (#113433)
optimisan Oct 23, 2024
401d123
[MCP] Optimize copies when src is used during backward propagation (#…
vladimirradosavljevic Oct 23, 2024
b225b15
[LoongArch] Merge base and offset for large offsets (#113277)
heiher Oct 23, 2024
d4dd770
[llvm-cxxfilt] De-emphasize "function" in llvm-cxxfilt docs and --hel…
playstation-edd Oct 23, 2024
6dad29a
[CLANG][AArch64]Add Neon vectors for mfloat8_t (#99865)
CarolineConcatto Oct 23, 2024
ba19e98
[lldb][CMake] If make isn't found, print a warning but don't error ou…
weliveindetail Oct 23, 2024
eb9af19
[clang-repl][CMake][MSVC] Wrap /EXPORT linker option for ICX (#112867)
Maetveis Oct 23, 2024
1f9953c
[clang] Make -fveclib={ArmPL,SLEEF} imply -fno-math-errno (#112580)
MacDue Oct 23, 2024
973fa98
[flang][OpenMP] Parse iterators, add to MAP clause, TODO for lowering…
kparzysz Oct 23, 2024
a19f05b
Revert "[PowerPC] Expand global named register support" (#113457)
lei137 Oct 23, 2024
5560f7e
[PS5][Driver] Query `OPT_r`/`OPT_shared`/`OPT_static` just once (NFC)…
playstation-edd Oct 23, 2024
7c72199
[libc++][ranges] LWG4016: container-insertable checks do not match wh…
Oct 23, 2024
294726d
Reapply "[InstCombine] Folding `(icmp eq/ne (and X, -P2), INT_MIN)`" …
goldsteinn Oct 23, 2024
8a9921f
[AArch64] Use INDEX for constant Neon step vectors (#113424)
rj-jesus Oct 23, 2024
3f5d12c
[AutoBump] Merge with 8a9921f5 (Oct 23)
jorickert Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {

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

} // namespace clang::tidy::cppcoreguidelines
4 changes: 4 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ Changes in existing checks
avoid false positive when member initialization depends on a structured
binding variable.

- Fixed :doc:`cppcoreguidelines-pro-type-union-access
<clang-tidy/checks/cppcoreguidelines/pro-type-union-access>` check to
report a location even when the member location is not valid.

- Improved :doc:`misc-definitions-in-headers
<clang-tidy/checks/misc/definitions-in-headers>` check by rewording the
diagnostic note that suggests adding ``inline``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ union U {
char union_member2;
} u;

union W {
template <class TP> operator TP *() const;
};

struct S {
int non_union_member;
union {
Expand All @@ -20,22 +24,25 @@ void f(char);
void f2(U);
void f3(U&);
void f4(U*);
W f5();

void check()
{
u.union_member1 = true;
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not access members of unions; consider using (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
auto b = u.union_member2;
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: do not access members of unions; use (boost::)variant instead
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: do not access members of unions; consider using (boost::)variant instead
auto a = &s.union_member;
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; use (boost::)variant instead
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; consider using (boost::)variant instead
f(s.u.union_member2);
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: do not access members of unions; use (boost::)variant instead
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: do not access members of unions; consider using (boost::)variant instead

s.non_union_member = 2; // OK

U u2 = u; // OK
f2(u); // OK
f3(u); // OK
f4(&u); // OK
void *ret = f5();
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: do not access members of unions; consider using (boost::)variant instead
}
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ Bug Fixes in This Version
- Fixed a crash using ``__array_rank`` on 64-bit targets. (#GH113044).
- The warning emitted for an unsupported register variable type now points to
the unsupported type instead of the ``register`` keyword (#GH109776).
- Fixed a crash when emit ctor for global variant with flexible array init (#GH113187).

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
10 changes: 6 additions & 4 deletions clang/include/clang/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -2661,8 +2661,10 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) bool is##Id##Type() const;
#include "clang/Basic/HLSLIntangibleTypes.def"
bool isHLSLSpecificType() const; // Any HLSL specific type
bool isHLSLIntangibleType() const; // Any HLSL intangible type
bool isHLSLBuiltinIntangibleType() const; // Any HLSL builtin intangible type
bool isHLSLAttributedResourceType() const;
bool isHLSLIntangibleType()
const; // Any HLSL intangible type (builtin, array, class)

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

inline bool Type::isHLSLIntangibleType() const {
inline bool Type::isHLSLBuiltinIntangibleType() const {
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) is##Id##Type() ||
return
#include "clang/Basic/HLSLIntangibleTypes.def"
isHLSLAttributedResourceType();
false;
}

inline bool Type::isHLSLSpecificType() const {
return isHLSLIntangibleType() || isa<HLSLAttributedResourceType>(this);
return isHLSLBuiltinIntangibleType() || isHLSLAttributedResourceType();
}

inline bool Type::isHLSLAttributedResourceType() const {
Expand Down
16 changes: 16 additions & 0 deletions clang/include/clang/Basic/AArch64SVEACLETypes.def
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@
SVE_TYPE(Name, Id, SingletonId)
#endif

#ifndef AARCH64_VECTOR_TYPE
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
SVE_TYPE(Name, Id, SingletonId)
#endif

#ifndef AARCH64_VECTOR_TYPE_MFLOAT
#define AARCH64_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF) \
AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId)
#endif


//===- Vector point types -----------------------------------------------===//

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

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

AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x8_t", "__MFloat8x8_t", MFloat8x8, MFloat8x8Ty, 8, 8, 1)
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x16_t", "__MFloat8x16_t", MFloat8x16, MFloat8x16Ty, 16, 8, 1)

#undef SVE_VECTOR_TYPE
#undef SVE_VECTOR_TYPE_BFLOAT
#undef SVE_VECTOR_TYPE_FLOAT
#undef SVE_VECTOR_TYPE_INT
#undef SVE_PREDICATE_TYPE
#undef SVE_PREDICATE_TYPE_ALL
#undef SVE_OPAQUE_TYPE
#undef AARCH64_VECTOR_TYPE_MFLOAT
#undef AARCH64_VECTOR_TYPE
#undef SVE_TYPE
1 change: 1 addition & 0 deletions clang/include/clang/Basic/Cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ enum class OffloadArch {
GFX1150,
GFX1151,
GFX1152,
GFX1153,
GFX12_GENERIC,
GFX1200,
GFX1201,
Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ def err_sls_hardening_arm_not_supported : Error<
def warn_drv_large_data_threshold_invalid_code_model: Warning<
"'%0' only applies to medium and large code models">,
InGroup<UnusedCommandLineArgument>;
def warn_drv_math_errno_enabled_after_veclib: Warning<
"math errno enabled by '%0' after it was implicitly disabled by '%1',"
" this may limit the utilization of the vector library">,
InGroup<MathErrnoEnabledWithVecLib>;

def note_drv_command_failed_diag_msg : Note<
"diagnostic msg: %0">;
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def FloatZeroConversion : DiagGroup<"float-zero-conversion">;
def FloatConversion :
DiagGroup<"float-conversion", [FloatOverflowConversion,
FloatZeroConversion]>;
def MathErrnoEnabledWithVecLib : DiagGroup<"math-errno-enabled-with-veclib">;

def FrameAddress : DiagGroup<"frame-address">;
def FreeNonHeapObject : DiagGroup<"free-nonheap-object">;
Expand Down
7 changes: 7 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,9 @@ def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_
def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Use the given vector functions library">,
HelpTextForVariants<[ClangOption, CC1Option],
"Use the given vector functions library. "
"Note: -fveclib={ArmPL,SLEEF} implies -fno-math-errno">,
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,AMDLIBM,none">,
NormalizedValuesScope<"llvm::driver::VectorLibrary">,
NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
Expand Down Expand Up @@ -5394,6 +5397,10 @@ def mfrecipe : Flag<["-"], "mfrecipe">, Group<m_loongarch_Features_Group>,
HelpText<"Enable frecipe.{s/d} and frsqrte.{s/d}">;
def mno_frecipe : Flag<["-"], "mno-frecipe">, Group<m_loongarch_Features_Group>,
HelpText<"Disable frecipe.{s/d} and frsqrte.{s/d}">;
def mlam_bh : Flag<["-"], "mlam-bh">, Group<m_loongarch_Features_Group>,
HelpText<"Enable amswap_[db].{b/h} and amadd_[db].{b/h}">;
def mno_lam_bh : Flag<["-"], "mno-lam-bh">, Group<m_loongarch_Features_Group>,
HelpText<"Disable amswap_[db].{b/h} and amadd_[db].{b/h}">;
def mannotate_tablejump : Flag<["-"], "mannotate-tablejump">, Group<m_loongarch_Features_Group>,
HelpText<"Enable annotate table jump instruction to correlate it with the jump table.">;
def mno_annotate_tablejump : Flag<["-"], "mno-annotate-tablejump">, Group<m_loongarch_Features_Group>,
Expand Down
1 change: 0 additions & 1 deletion clang/include/clang/Sema/SemaHLSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class SemaHLSL : public SemaBase {

// HLSL Type trait implementations
bool IsScalarizedLayoutCompatible(QualType T1, QualType T2) const;
bool IsIntangibleType(QualType T1);

bool CheckCompatibleParameterABI(FunctionDecl *New, FunctionDecl *Old);

Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Serialization/ASTBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ enum PredefinedTypeIDs {
///
/// Type IDs for non-predefined types will start at
/// NUM_PREDEF_TYPE_IDs.
const unsigned NUM_PREDEF_TYPE_IDS = 509;
const unsigned NUM_PREDEF_TYPE_IDS = 511;

// Ensure we do not overrun the predefined types we reserved
// in the enum PredefinedTypeIDs above.
Expand Down
5 changes: 3 additions & 2 deletions clang/include/clang/Serialization/ModuleFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define LLVM_CLANG_SERIALIZATION_MODULEFILE_H

#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Serialization/ASTBitCodes.h"
Expand Down Expand Up @@ -144,8 +145,8 @@ class ModuleFile {
/// The base directory of the module.
std::string BaseDirectory;

std::string getTimestampFilename() const {
return FileName + ".timestamp";
static std::string getTimestampFilename(StringRef FileName) {
return (FileName + ".timestamp").str();
}

/// The original source file name that was used to build the
Expand Down
12 changes: 12 additions & 0 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,12 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
Width = 0; \
Align = 16; \
break;
#define AARCH64_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, \
ElBits, NF) \
case BuiltinType::Id: \
Width = NumEls * ElBits * NF; \
Align = NumEls * ElBits; \
break;
#include "clang/Basic/AArch64SVEACLETypes.def"
#define PPC_VECTOR_TYPE(Name, Id, Size) \
case BuiltinType::Id: \
Expand Down Expand Up @@ -4361,6 +4367,11 @@ ASTContext::getBuiltinVectorTypeInfo(const BuiltinType *Ty) const {
#define SVE_PREDICATE_TYPE_ALL(Name, MangledName, Id, SingletonId, NumEls, NF) \
case BuiltinType::Id: \
return {BoolTy, llvm::ElementCount::getScalable(NumEls), NF};
#define AARCH64_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, \
ElBits, NF) \
case BuiltinType::Id: \
return {getIntTypeForBitwidth(ElBits, false), \
llvm::ElementCount::getFixed(NumEls), NF};
#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId)
#include "clang/Basic/AArch64SVEACLETypes.def"

Expand Down Expand Up @@ -4427,6 +4438,7 @@ QualType ASTContext::getScalableVectorType(QualType EltTy, unsigned NumElts,
if (EltTy->isBooleanType() && NumElts == (NumEls * NF) && NumFields == 1) \
return SingletonId;
#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId)
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId)
#include "clang/Basic/AArch64SVEACLETypes.def"
} else if (Target->hasRISCVVTypes()) {
uint64_t EltTySize = getTypeSize(EltTy);
Expand Down
14 changes: 10 additions & 4 deletions clang/lib/AST/ByteCode/Interp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,17 @@ static bool diagnoseUnknownDecl(InterpState &S, CodePtr OpPC,
return false;
}

if (!D->getType().isConstQualified())
if (!D->getType().isConstQualified()) {
diagnoseNonConstVariable(S, OpPC, D);
else if (const auto *VD = dyn_cast<VarDecl>(D);
VD && !VD->getAnyInitializer())
diagnoseMissingInitializer(S, OpPC, VD);
} else if (const auto *VD = dyn_cast<VarDecl>(D)) {
if (!VD->getAnyInitializer()) {
diagnoseMissingInitializer(S, OpPC, VD);
} else {
const SourceInfo &Loc = S.Current->getSource(OpPC);
S.FFDiag(Loc, diag::note_constexpr_var_init_non_constant, 1) << VD;
S.Note(VD->getLocation(), diag::note_declared_at);
}
}

return false;
}
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/DeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,8 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (const RecordType *RT = dyn_cast<RecordType>(Ty))
data().IsHLSLIntangible |= RT->getAsCXXRecordDecl()->isHLSLIntangible();
else
data().IsHLSLIntangible |= Ty->isHLSLIntangibleType();
data().IsHLSLIntangible |= (Ty->isHLSLAttributedResourceType() ||
Ty->isHLSLBuiltinIntangibleType());
}
}

Expand Down
5 changes: 5 additions & 0 deletions clang/lib/AST/ItaniumMangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3430,6 +3430,11 @@ void CXXNameMangler::mangleType(const BuiltinType *T) {
type_name = MangledName; \
Out << (type_name == Name ? "u" : "") << type_name.size() << type_name; \
break;
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
case BuiltinType::Id: \
type_name = MangledName; \
Out << (type_name == Name ? "u" : "") << type_name.size() << type_name; \
break;
#include "clang/Basic/AArch64SVEACLETypes.def"
#define PPC_VECTOR_TYPE(Name, Id, Size) \
case BuiltinType::Id: \
Expand Down
37 changes: 35 additions & 2 deletions clang/lib/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,9 +2484,19 @@ bool Type::isSVESizelessBuiltinType() const {
if (const BuiltinType *BT = getAs<BuiltinType>()) {
switch (BT->getKind()) {
// SVE Types
#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
#define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
case BuiltinType::Id: \
return true;
#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) \
case BuiltinType::Id: \
return true;
#define SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId) \
case BuiltinType::Id: \
return true;
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
case BuiltinType::Id: \
return false;
#include "clang/Basic/AArch64SVEACLETypes.def"
return true;
default:
return false;
}
Expand Down Expand Up @@ -5030,6 +5040,29 @@ bool Type::hasSizedVLAType() const {
return false;
}

bool Type::isHLSLIntangibleType() const {
const Type *Ty = getUnqualifiedDesugaredType();

// check if it's a builtin type first
if (Ty->isBuiltinType())
return Ty->isHLSLBuiltinIntangibleType();

// unwrap arrays
while (isa<ConstantArrayType>(Ty))
Ty = Ty->getArrayElementTypeNoTypeQual();

const RecordType *RT =
dyn_cast<RecordType>(Ty->getUnqualifiedDesugaredType());
if (!RT)
return false;

CXXRecordDecl *RD = RT->getAsCXXRecordDecl();
assert(RD != nullptr &&
"all HLSL struct and classes should be CXXRecordDecl");
assert(RD->isCompleteDefinition() && "expecting complete type");
return RD->isHLSLIntangible();
}

QualType::DestructionKind QualType::isDestructedTypeImpl(QualType type) {
switch (type.getObjCLifetime()) {
case Qualifiers::OCL_None:
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Basic/Cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ static const OffloadArchToStringMap arch_names[] = {
GFX(1150), // gfx1150
GFX(1151), // gfx1151
GFX(1152), // gfx1152
GFX(1153), // gfx1153
{OffloadArch::GFX12_GENERIC, "gfx12-generic", "compute_amdgcn"},
GFX(1200), // gfx1200
GFX(1201), // gfx1201
Expand Down
7 changes: 6 additions & 1 deletion clang/lib/Basic/Targets/LoongArch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void LoongArchTargetInfo::getTargetDefines(const LangOptions &Opts,
// TODO: As more features of the V1.1 ISA are supported, a unified "v1.1"
// arch feature set will be used to include all sub-features belonging to
// the V1.1 ISA version.
if (HasFeatureFrecipe)
if (HasFeatureFrecipe && HasFeatureLAM_BH)
Builder.defineMacro("__loongarch_arch",
Twine('"') + "la64v1.1" + Twine('"'));
else
Expand Down Expand Up @@ -236,6 +236,9 @@ void LoongArchTargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasFeatureFrecipe)
Builder.defineMacro("__loongarch_frecipe", Twine(1));

if (HasFeatureLAM_BH)
Builder.defineMacro("__loongarch_lam_bh", Twine(1));

StringRef ABI = getABI();
if (ABI == "lp64d" || ABI == "lp64f" || ABI == "lp64s")
Builder.defineMacro("__loongarch_lp64");
Expand Down Expand Up @@ -312,6 +315,8 @@ bool LoongArchTargetInfo::handleTargetFeatures(
HasUnalignedAccess = false;
else if (Feature == "+frecipe")
HasFeatureFrecipe = true;
else if (Feature == "+lam-bh")
HasFeatureLAM_BH = true;
}
return true;
}
Expand Down
Loading
Loading