Skip to content

Commit 116b447

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/qmacc-test
2 parents 871a3df + 1937a36 commit 116b447

File tree

468 files changed

+26437
-23531
lines changed

Some content is hidden

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

468 files changed

+26437
-23531
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@ C++ Language Changes
294294
C++2c Feature Support
295295
^^^^^^^^^^^^^^^^^^^^^
296296

297-
- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports
298-
`P2647R1 A trait for implicit lifetime types <https://wg21.link/p2674r1>`_
299-
300297
- Add ``__builtin_is_virtual_base_of`` intrinsic, which supports
301298
`P2985R0 A type trait for detecting virtual base classes <https://wg21.link/p2985r0>`_
302299

@@ -318,6 +315,9 @@ C++23 Feature Support
318315

319316
- ``__cpp_explicit_this_parameter`` is now defined. (#GH82780)
320317

318+
- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports
319+
`P2674R1 A trait for implicit lifetime types <https://wg21.link/p2674r1>`_
320+
321321
- Add support for `P2280R4 Using unknown pointers and references in constant expressions <https://wg21.link/P2280R4>`_. (#GH63139)
322322

323323
C++20 Feature Support
@@ -975,6 +975,8 @@ Bug Fixes to C++ Support
975975
- Fixed a nested lambda substitution issue for constraint evaluation. (#GH123441)
976976
- Fixed various false diagnostics related to the use of immediate functions. (#GH123472)
977977
- Fix immediate escalation not propagating through inherited constructors. (#GH112677)
978+
- Fixed assertions or false compiler diagnostics in the case of C++ modules for
979+
lambda functions or inline friend functions defined inside templates (#GH122493).
978980

979981
Bug Fixes to AST Handling
980982
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1272,6 +1274,13 @@ libclang
12721274
- Added ``clang_getOffsetOfBase``, which allows computing the offset of a base
12731275
class in a class's layout.
12741276

1277+
1278+
Code Completion
1279+
---------------
1280+
1281+
- Use ``HeuristicResolver`` (upstreamed from clangd) to improve code completion results
1282+
in dependent code
1283+
12751284
Static Analyzer
12761285
---------------
12771286

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5191,51 +5191,51 @@ let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] i
51915191
}
51925192

51935193
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5194-
def vcvtne2ph2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
5194+
def vcvt2ph2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
51955195
}
51965196

51975197
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5198-
def vcvtne2ph2bf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
5198+
def vcvt2ph2bf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
51995199
}
52005200

52015201
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5202-
def vcvtne2ph2bf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
5202+
def vcvt2ph2bf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
52035203
}
52045204

52055205
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5206-
def vcvtne2ph2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
5206+
def vcvt2ph2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
52075207
}
52085208

52095209
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5210-
def vcvtne2ph2bf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
5210+
def vcvt2ph2bf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
52115211
}
52125212

52135213
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5214-
def vcvtne2ph2bf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
5214+
def vcvt2ph2bf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
52155215
}
52165216

52175217
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5218-
def vcvtne2ph2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
5218+
def vcvt2ph2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
52195219
}
52205220

52215221
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5222-
def vcvtne2ph2hf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
5222+
def vcvt2ph2hf8_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
52235223
}
52245224

52255225
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5226-
def vcvtne2ph2hf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
5226+
def vcvt2ph2hf8_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
52275227
}
52285228

52295229
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5230-
def vcvtne2ph2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
5230+
def vcvt2ph2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<8, _Float16>)">;
52315231
}
52325232

52335233
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5234-
def vcvtne2ph2hf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
5234+
def vcvt2ph2hf8s_256 : X86Builtin<"_Vector<32, char>(_Vector<16, _Float16>, _Vector<16, _Float16>)">;
52355235
}
52365236

52375237
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5238-
def vcvtne2ph2hf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
5238+
def vcvt2ph2hf8s_512 : X86Builtin<"_Vector<64, char>(_Vector<32, _Float16>, _Vector<32, _Float16>)">;
52395239
}
52405240

52415241
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
@@ -5251,51 +5251,51 @@ let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] i
52515251
}
52525252

52535253
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5254-
def vcvtneph2bf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
5254+
def vcvtph2bf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
52555255
}
52565256

52575257
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5258-
def vcvtneph2bf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
5258+
def vcvtph2bf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
52595259
}
52605260

52615261
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5262-
def vcvtneph2bf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
5262+
def vcvtph2bf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
52635263
}
52645264

52655265
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5266-
def vcvtneph2bf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
5266+
def vcvtph2bf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
52675267
}
52685268

52695269
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5270-
def vcvtneph2bf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
5270+
def vcvtph2bf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
52715271
}
52725272

52735273
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5274-
def vcvtneph2bf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
5274+
def vcvtph2bf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
52755275
}
52765276

52775277
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5278-
def vcvtneph2hf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
5278+
def vcvtph2hf8_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
52795279
}
52805280

52815281
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5282-
def vcvtneph2hf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
5282+
def vcvtph2hf8_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
52835283
}
52845284

52855285
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5286-
def vcvtneph2hf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
5286+
def vcvtph2hf8_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
52875287
}
52885288

52895289
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
5290-
def vcvtneph2hf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
5290+
def vcvtph2hf8s_128_mask : X86Builtin<"_Vector<16, char>(_Vector<8, _Float16>, _Vector<16, char>, unsigned char)">;
52915291
}
52925292

52935293
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
5294-
def vcvtneph2hf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
5294+
def vcvtph2hf8s_256_mask : X86Builtin<"_Vector<16, char>(_Vector<16, _Float16>, _Vector<16, char>, unsigned short)">;
52955295
}
52965296

52975297
let Features = "avx10.2-512", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
5298-
def vcvtneph2hf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
5298+
def vcvtph2hf8s_512_mask : X86Builtin<"_Vector<32, char>(_Vector<32, _Float16>, _Vector<32, char>, unsigned int)">;
52995299
}
53005300

53015301
let Features = "avx10.2-256", Attributes = [NoThrow, RequiredVectorWidth<128>] in {

clang/include/clang/Serialization/ASTReader.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,18 @@ class ASTReader
546546

547547
/// Mapping from main decl ID to the related decls IDs.
548548
///
549-
/// These related decls have to be loaded right after the main decl.
550-
/// It is required to have canonical declaration for related decls from the
551-
/// same module as the enclosing main decl. Without this, due to lazy
552-
/// deserialization, canonical declarations for the main decl and related can
553-
/// be selected from different modules.
549+
/// The key is the main decl ID, and the value is a vector of related decls
550+
/// that must be loaded immediately after the main decl. This is necessary
551+
/// to ensure that the definition for related decls comes from the same module
552+
/// as the enclosing main decl. Without this, due to lazy deserialization,
553+
/// the definition for the main decl and related decls may come from different
554+
/// modules. It is used for the following cases:
555+
/// - Lambda inside a template function definition: The main declaration is
556+
/// the enclosing function, and the related declarations are the lambda
557+
/// declarations.
558+
/// - Friend function defined inside a template CXXRecord declaration: The
559+
/// main declaration is the enclosing record, and the related declarations
560+
/// are the friend functions.
554561
llvm::DenseMap<GlobalDeclID, SmallVector<GlobalDeclID, 4>> RelatedDeclsMap;
555562

556563
struct PendingUpdateRecord {

clang/lib/Driver/ToolChains/Arch/ARM.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,13 @@ arm::FloatABI arm::getDefaultFloatABI(const llvm::Triple &Triple) {
443443
case llvm::Triple::MuslEABIHF:
444444
case llvm::Triple::EABIHF:
445445
return FloatABI::Hard;
446+
case llvm::Triple::Android:
446447
case llvm::Triple::GNUEABI:
447448
case llvm::Triple::GNUEABIT64:
448449
case llvm::Triple::MuslEABI:
449450
case llvm::Triple::EABI:
450451
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
451452
return FloatABI::SoftFP;
452-
case llvm::Triple::Android:
453-
return (SubArch >= 7) ? FloatABI::SoftFP : FloatABI::Soft;
454453
default:
455454
return FloatABI::Invalid;
456455
}

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,9 @@ void NVPTX::Linker::ConstructJob(Compilation &C, const JobAction &JA,
639639
CmdArgs.push_back(
640640
Args.MakeArgString("--plugin-opt=-mattr=" + llvm::join(Features, ",")));
641641

642+
// Enable ctor / dtor lowering for the direct / freestanding NVPTX target.
643+
CmdArgs.append({"-mllvm", "--nvptx-lower-global-ctor-dtor"});
644+
642645
// Add paths for the default clang library path.
643646
SmallString<256> DefaultLibPath =
644647
llvm::sys::path::parent_path(TC.getDriver().Dir);
@@ -783,7 +786,7 @@ void NVPTXToolChain::addClangTargetOptions(
783786
// If we are compiling with a standalone NVPTX toolchain we want to try to
784787
// mimic a standard environment as much as possible. So we enable lowering
785788
// ctor / dtor functions to global symbols that can be registered.
786-
if (Freestanding)
789+
if (Freestanding && !getDriver().isUsingLTO())
787790
CC1Args.append({"-mllvm", "--nvptx-lower-global-ctor-dtor"});
788791
}
789792

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,6 @@ std::string Linux::getMultiarchTriple(const Driver &D,
180180

181181
static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
182182
if (Triple.isMIPS()) {
183-
if (Triple.isAndroid()) {
184-
StringRef CPUName;
185-
StringRef ABIName;
186-
tools::mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName);
187-
if (CPUName == "mips32r6")
188-
return "libr6";
189-
if (CPUName == "mips32r2")
190-
return "libr2";
191-
}
192183
// lib32 directory has a special meaning on MIPS targets.
193184
// It contains N32 ABI binaries. Use this folder if produce
194185
// code for N32 ABI only.

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ using ArgumentConsumer = CompilerInvocation::ArgumentConsumer;
282282
#undef OPTTABLE_STR_TABLE_CODE
283283

284284
static llvm::StringRef lookupStrInTable(unsigned Offset) {
285-
return &OptionStrTable[Offset];
285+
return OptionStrTable[Offset];
286286
}
287287

288288
#define SIMPLE_ENUM_VALUE_TABLE

0 commit comments

Comments
 (0)