Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
95dfe79
[MachO] Fix test failure. (#167598)
Prabhuk Nov 12, 2025
fcba304
AMDGPU: Remove override of TargetInstrInfo::getRegClass (#159886)
arsenm Nov 12, 2025
362119d
[gn build] Port 5c3323a59fd2
llvmgnsyncbot Nov 12, 2025
2acd652
Fix lldb-dap non-leaf frame source resolution issue (#165944)
jeffreytan81 Nov 12, 2025
79d9ae7
[AMDGPU][GISel] Add RegBankLegalize support for G_AMDGPU_WAVE_ADDRESS…
chinmaydd Nov 12, 2025
ea10026
Reland "[LoongArch] Add `isSafeToMove` hook to prevent unsafe instruc…
heiher Nov 12, 2025
6655681
[llvm-offload-wrapper] Fix Triple and OpenMP handling (#167580)
jhuber6 Nov 12, 2025
a863fd8
[NFC] Generalize the arithmetic type for `getDisjunctionWeights` (#16…
mtrofin Nov 12, 2025
75e38aa
RuntimeLibcalls: Add libcall entries for sleef and armpl modf functio…
arsenm Nov 12, 2025
4b9771e
DAG: Use modf vector libcalls through RuntimeLibcalls (#166986)
arsenm Nov 12, 2025
c1f18a2
InferAddressSpaces: Add more baseline tests for assume handling (#167…
arsenm Nov 12, 2025
a100a6c
[llvm][llvm-dis] Fix 'llvm-dis' with '--materialize-metadata --show-a…
t-baydyusenov Nov 12, 2025
3e6442a
[WebAssembly] Use MCRegister::id(). NFC (#167609)
topperc Nov 12, 2025
cf35502
[libunwind] Fix execution flow imbalance when using C++ Exceptions (#…
medismailben Nov 12, 2025
95f2728
DAG: Stop using TargetLibraryInfo for multi-result FP intrinsic codeg…
arsenm Nov 12, 2025
389a23c
[libc++] Implement P2988R12: `std::optional<T&>` (#155202)
smallp-o-p Nov 12, 2025
175e3be
[MLIR][Python] Add region_op wrappers for linalg (#167616)
ashermancinelli Nov 12, 2025
905ee44
[NFC] [C++20] [Modules] Test that we can avoid adding more specializa…
ChuanqiXu9 Nov 12, 2025
1f38d49
ValueMapper: Delete unused initializers of replaced appending globals.
pcc Nov 12, 2025
c5aace4
DAG: Move expandMultipleResultFPLibCall to TargetLowering (NFC) (#166…
arsenm Nov 12, 2025
5465979
libunwind: Implement the unw_strerror function for better nongnu libu…
arrowd Nov 12, 2025
ce32b73
Orc rt session wrap unwrap (#167635)
lhames Nov 12, 2025
a664cad
Wasm: Fix hardcoding _Unwind_CallPersonality function name (#167612)
arsenm Nov 12, 2025
7d9b7e8
PPC: Mark xfailed sincospi test as unsupported with EXPENSIVE_CHECKS …
arsenm Nov 12, 2025
a7ceeff
[orc-rt] Make Session explicitly immovable. (#167640)
lhames Nov 12, 2025
ae2b303
[C++20] [Modules] Don't import initializer/pending implicit instantia…
ChuanqiXu9 Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions clang/lib/Serialization/ASTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4087,10 +4087,14 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
std::errc::illegal_byte_sequence,
"Invalid PENDING_IMPLICIT_INSTANTIATIONS block");

for (unsigned I = 0, N = Record.size(); I != N; /* in loop */) {
PendingInstantiations.push_back(
{ReadDeclID(F, Record, I),
ReadSourceLocation(F, Record, I).getRawEncoding()});
// For standard C++20 module, we will only reads the instantiations
// if it is the main file.
if (!F.StandardCXXModule || F.Kind == MK_MainFile) {
for (unsigned I = 0, N = Record.size(); I != N; /* in loop */) {
PendingInstantiations.push_back(
{ReadDeclID(F, Record, I),
ReadSourceLocation(F, Record, I).getRawEncoding()});
}
}
break;

Expand Down Expand Up @@ -6438,10 +6442,13 @@ llvm::Error ASTReader::ReadSubmoduleBlock(ModuleFile &F,
case SUBMODULE_INITIALIZERS: {
if (!ContextObj)
break;
SmallVector<GlobalDeclID, 16> Inits;
for (unsigned I = 0; I < Record.size(); /*in loop*/)
Inits.push_back(ReadDeclID(F, Record, I));
ContextObj->addLazyModuleInitializers(CurrentModule, Inits);
// Standard C++ module has its own way to initialize variables.
if (!F.StandardCXXModule || F.Kind == MK_MainFile) {
SmallVector<GlobalDeclID, 16> Inits;
for (unsigned I = 0; I < Record.size(); /*in loop*/)
Inits.push_back(ReadDeclID(F, Record, I));
ContextObj->addLazyModuleInitializers(CurrentModule, Inits);
}
break;
}

Expand Down
22 changes: 12 additions & 10 deletions clang/lib/Serialization/ASTWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3247,7 +3247,7 @@ void ASTWriter::WriteSubmodules(Module *WritingModule, ASTContext *Context) {

// Emit the reachable initializers.
// The initializer may only be unreachable in reduced BMI.
if (Context) {
if (Context && !GeneratingReducedBMI) {
RecordData Inits;
for (Decl *D : Context->getModuleInitializers(Mod))
if (wasDeclEmitted(D))
Expand Down Expand Up @@ -5827,17 +5827,19 @@ void ASTWriter::WriteSpecialDeclRecords(Sema &SemaRef) {
Stream.EmitRecord(UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES,
UnusedLocalTypedefNameCandidates);

// Write the record containing pending implicit instantiations.
RecordData PendingInstantiations;
for (const auto &I : SemaRef.PendingInstantiations) {
if (!wasDeclEmitted(I.first))
continue;
if (!GeneratingReducedBMI) {
// Write the record containing pending implicit instantiations.
RecordData PendingInstantiations;
for (const auto &I : SemaRef.PendingInstantiations) {
if (!wasDeclEmitted(I.first))
continue;

AddDeclRef(I.first, PendingInstantiations);
AddSourceLocation(I.second, PendingInstantiations);
AddDeclRef(I.first, PendingInstantiations);
AddSourceLocation(I.second, PendingInstantiations);
}
if (!PendingInstantiations.empty())
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations);
}
if (!PendingInstantiations.empty())
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations);

// Write the record containing declaration references of Sema.
RecordData SemaDeclRefs;
Expand Down
28 changes: 28 additions & 0 deletions clang/test/Modules/avoid-specialization-update-in-reduced-bmi.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// RUN: rm -rf %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-module-interface -o %t/base.pcm
// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-module-interface -o %t/update.pcm
// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm --check-prefix=FULL
//
// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-reduced-module-interface -o %t/base.pcm
// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-reduced-module-interface -o %t/update.pcm
// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm

//--- base.cppm
export module base;

export template <typename T>
struct base {
T value;
};

//--- update.cppm
export module update;
import base;
export int update() {
return base<int>().value;
}

// FULL: TEMPLATE_SPECIALIZATION
// CHECK-NOT: TEMPLATE_SPECIALIZATION
38 changes: 38 additions & 0 deletions clang/test/Modules/pr166068.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/flyweight.cppm -emit-reduced-module-interface -o %t/flyweight.pcm
// RUN: %clang_cc1 -std=c++20 %t/account.cppm -emit-reduced-module-interface -o %t/account.pcm -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/core.cppm -emit-reduced-module-interface -o %t/core.pcm -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/core.cppm -fprebuilt-module-path=%t -emit-llvm -disable-llvm-passes -o - | FileCheck %t/core.cppm

//--- flyweight.cppm
module;
template <typename> struct flyweight_core {
static bool init() { (void)__builtin_operator_new(2); return true; }
static bool static_initializer;
};
template <typename T> bool flyweight_core<T>::static_initializer = init();
export module flyweight;
export template <class> void flyweight() {
(void)flyweight_core<int>::static_initializer;
}

//--- account.cppm
export module account;
import flyweight;
export void account() {
(void)::flyweight<int>;
}

//--- core.cppm
export module core;
import account;

extern "C" void core() {}

// Fine enough to check it won't crash.
// CHECK-NOT: init
// CHECK-NOT: static_initializer
// CHECK: define {{.*}}@core(
2 changes: 2 additions & 0 deletions libcxx/docs/FeatureTestMacroTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_not_fn`` ``202306L``
---------------------------------------------------------- -----------------
``__cpp_lib_optional`` ``202506L``
---------------------------------------------------------- -----------------
``__cpp_lib_optional_range_support`` ``202406L``
---------------------------------------------------------- -----------------
``__cpp_lib_out_ptr`` ``202311L``
Expand Down
1 change: 1 addition & 0 deletions libcxx/docs/ReleaseNotes/22.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Implemented Papers

- P2321R2: ``zip`` (`Github <https://llvm.org/PR105169>`__) (The paper is partially implemented. ``zip_transform_view``
is implemented in this release)
- P2988R12: ``std::optional<T&>`` (`Github <https://llvm.org/PR148131>`__)
- P3044R2: sub-``string_view`` from ``string`` (`Github <https://llvm.org/PR148140>`__)
- P3223R2: Making ``std::istream::ignore`` less surprising (`Github <https://llvm.org/PR148178>`__)
- P3060R3: Add ``std::views::indices(n)`` (`Github <https://llvm.org/PR148175>`__)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx2cPapers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"`P3293R3 <https://wg21.link/P3293R3>`__","Splicing a base class subobject","2025-06 (Sofia)","","","`#148125 <https://github.com/llvm/llvm-project/issues/148125>`__",""
"`P3491R3 <https://wg21.link/P3491R3>`__","``define_static_{string,object,array}``","2025-06 (Sofia)","","","`#148126 <https://github.com/llvm/llvm-project/issues/148126>`__",""
"`P3096R12 <https://wg21.link/P3096R12>`__","Function Parameter Reflection in Reflection for C++26","2025-06 (Sofia)","","","`#148127 <https://github.com/llvm/llvm-project/issues/148127>`__",""
"`P2988R12 <https://wg21.link/P2988R12>`__","``std::optional<T&>``","2025-06 (Sofia)","","","`#148131 <https://github.com/llvm/llvm-project/issues/148131>`__",""
"`P2988R12 <https://wg21.link/P2988R12>`__","``std::optional<T&>``","2025-06 (Sofia)","|Complete|","22","`#148131 <https://github.com/llvm/llvm-project/issues/148131>`__",""
"`P3348R4 <https://wg21.link/P3348R4>`__","C++26 should refer to C23 not C17","2025-06 (Sofia)","","","`#148133 <https://github.com/llvm/llvm-project/issues/148133>`__",""
"`P3037R6 <https://wg21.link/P3037R6>`__","``constexpr`` ``std::shared_ptr`` and friends","2025-06 (Sofia)","","","`#148135 <https://github.com/llvm/llvm-project/issues/148135>`__",""
"`P3284R4 <https://wg21.link/P3284R4>`__","``write_env`` and ``unstoppable`` Sender Adaptors","2025-06 (Sofia)","","","`#148136 <https://github.com/llvm/llvm-project/issues/148136>`__",""
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__iterator/wrap_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class __wrap_iter {
friend class span;
template <class _Tp, size_t _Size>
friend struct array;
template <class _Tp>
friend class optional;
template <class _Tp, class>
friend struct __optional_iterator;
};

template <class _Iter1>
Expand Down
Loading