Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3 |
|
#
6c6351ee |
| 28-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Optimize construction and usage of the submodule index (#113391)
This patch avoids eagerly populating the submodule index on `Module`
construction. The `StringMap` allocation shows
[clang][modules] Optimize construction and usage of the submodule index (#113391)
This patch avoids eagerly populating the submodule index on `Module`
construction. The `StringMap` allocation shows up in my profiles of
`clang-scan-deps`, while the index is not necessary most of the time. We
still construct it on-demand.
Moreover, this patch avoids performing qualified submodule lookup in
`ASTReader` whenever we're serializing a module graph whose top-level
module is unknown. This is pointless, since that's guaranteed to never
find any existing submodules anyway.
This speeds up `clang-scan-deps` by ~0.5% on my workload.
show more ...
|
#
61946687 |
| 25-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Shrink the size of `Module::Headers` (#113395)
This patch shrinks the size of the `Module` class from 2112B to 1624B. I
wasn't able to get a good data on the actual impact on memor
[clang][modules] Shrink the size of `Module::Headers` (#113395)
This patch shrinks the size of the `Module` class from 2112B to 1624B. I
wasn't able to get a good data on the actual impact on memory usage, but
given my `clang-scan-deps` workload at hand (with tens of thousands of
instances), I think there should be some win here. This also speeds up
my benchmark by under 0.1%.
show more ...
|
#
8bbd0797 |
| 22-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] Allocate `Module` instances in `BumpPtrAllocator` (#112795)
In `clang-scan-deps`, we're creating lots of `Module` instances.
Allocating them all in a bump-pointer allocator reduces the numb
[clang] Allocate `Module` instances in `BumpPtrAllocator` (#112795)
In `clang-scan-deps`, we're creating lots of `Module` instances.
Allocating them all in a bump-pointer allocator reduces the number of
retired instructions by 1-1.5% on my workload.
show more ...
|
Revision tags: llvmorg-19.1.2, llvmorg-19.1.1 |
|
#
7db641af |
| 19-Sep-2024 |
Youngsuk Kim <youngsuk.kim@hpe.com> |
[clang] Don't call raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op. As specified in the docs, raw_string_ostream is always unbuffered
|
Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
8918d35d |
| 03-Jun-2024 |
David Stone <davidfromonline@gmail.com> |
[clang][Modules] Move `ASTSourceDescriptor` into its own file (#67930)
|
Revision tags: llvmorg-18.1.6 |
|
#
7d913c5e |
| 05-May-2024 |
David Stone <davidfromonline@gmail.com> |
[clang][Modules] Make `Module::Requirement` a struct (NFC) (#67900)
`Module::Requirement` was defined as a `std::pair<std::string, bool>`.
This required a comment to explain what the data members m
[clang][Modules] Make `Module::Requirement` a struct (NFC) (#67900)
`Module::Requirement` was defined as a `std::pair<std::string, bool>`.
This required a comment to explain what the data members mean and makes
the usage harder to understand. Replace this with a struct with two
members, `FeatureName` and `RequiredState`.
---------
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
show more ...
|
Revision tags: llvmorg-18.1.5, llvmorg-18.1.4 |
|
#
41383674 |
| 13-Apr-2024 |
Ian Anderson <iana@apple.com> |
[modules] allow use of ptrauth module from no_undeclared_includes system modules (#88432)
Co-authored-by: Alex Lorenz <arphaman@gmail.com>
|
Revision tags: llvmorg-18.1.3, llvmorg-18.1.2 |
|
#
f50d3582 |
| 13-Mar-2024 |
Ian Anderson <iana@apple.com> |
[clang][modules] giving the __stddef_ headers their own modules can cause redeclaration errors with -fbuiltin-headers-in-system-modules (#84127)
On Apple platforms, some of the stddef.h types are al
[clang][modules] giving the __stddef_ headers their own modules can cause redeclaration errors with -fbuiltin-headers-in-system-modules (#84127)
On Apple platforms, some of the stddef.h types are also declared in
system headers. In particular NULL has a conflicting declaration in
<sys/_types/_null.h>. When that's in a different module from
<__stddef_null.h>, redeclaration errors can occur.
Make the \_\_stddef_ headers be non-modular in
-fbuiltin-headers-in-system-modules and restore them back to not
respecting their header guards. Still define the header guards though.
__stddef_max_align_t.h was in _Builtin_stddef_max_align_t prior to the
addition of _Builtin_stddef, and it needs to stay in a module because
struct's can't be type merged. __stddef_wint_t.h didn't used to have a
module, but leave it in it current module since it doesn't really belong
to stddef.h.
show more ...
|
Revision tags: llvmorg-18.1.1 |
|
#
d3df2a83 |
| 06-Mar-2024 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[C++20] [Modules] Handle transitive import in the module properly
Close https://github.com/llvm/llvm-project/issues/84002
Per [module.import]p7:
> Additionally, when a module-import-declaration in
[C++20] [Modules] Handle transitive import in the module properly
Close https://github.com/llvm/llvm-project/issues/84002
Per [module.import]p7:
> Additionally, when a module-import-declaration in a module unit of > some module M imports another module unit U of M, it also imports all > translation units imported by non-exported module-import-declarations > in the module unit purview of U.
However, we only tried to implement it during the implicit import of primary module interface for module implementation unit.
Also we didn't implement the last sentence from [module.import]p7 completely:
> These rules can in turn lead to the importation of yet more > translation units.
This patch tries to care the both issues.
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
#
00e80fbf |
| 11-Feb-2024 |
Danny Mösch <danny.moesch@icloud.com> |
[NFC] Correct C++ standard names (#81421)
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
f3dcc235 |
| 13-Dec-2023 |
Kazu Hirata <kazu@google.com> |
[clang] Use StringRef::{starts,ends}_with (NFC) (#75149)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}:
[clang] Use StringRef::{starts,ends}_with (NFC) (#75149)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.
I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
show more ...
|
#
cc4ecfd6 |
| 09-Dec-2023 |
Kazu Hirata <kazu@google.com> |
[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_w
[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20. Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
a3efd892 |
| 01-Nov-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Don't prevent translation of FW_Private includes when explicitly building FW (#70714)
We prevent translating `#include <FW/PrivateHeader.h>` into an import of
FW_Private when compi
[clang][modules] Don't prevent translation of FW_Private includes when explicitly building FW (#70714)
We prevent translating `#include <FW/PrivateHeader.h>` into an import of
FW_Private when compiling the implementation of FW or FW_Private. This
is specified via `-fmodule-name=` on the TU command line (used to be
`-fmodule-implementation-of`).
This logic is supposed to only kick in when imported directly from a TU,
but it currently also kicks in when compiling the public FW module
explicitly (since it also has `-fmodule-name=` on the command line).
This patch makes sure this logic only kicks in for the case that used to
be `-fmodule-implementation-of` (for the TU), and not for all
`-fmodule-name=` cases (especially for the explicit compile of a
module).
rdar://101051277; related: rdar://37500098&38434694
show more ...
|
Revision tags: llvmorg-17.0.4 |
|
#
1afb313b |
| 20-Oct-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Use file name as requested (#68957)
This prevents redefinition errors due to having multiple paths for the
same module map. (rdar://24116019)
Originally implemented and tested d
[clang][modules] Use file name as requested (#68957)
This prevents redefinition errors due to having multiple paths for the
same module map. (rdar://24116019)
Originally implemented and tested downstream by @bcardosolopes, I just
made use of `FileEntryRef::getNameAsRequested()`.
show more ...
|
Revision tags: llvmorg-17.0.3 |
|
#
4ee8c676 |
| 04-Oct-2023 |
Ian Anderson <iana@apple.com> |
[Modules] no_undeclared_includes modules (Apple Darwin) don't work the clang modules (#68241)
All of the _Builtin_stdarg and _Builtin_stddef submodules need to be
allowed from [no_undeclared_includ
[Modules] no_undeclared_includes modules (Apple Darwin) don't work the clang modules (#68241)
All of the _Builtin_stdarg and _Builtin_stddef submodules need to be
allowed from [no_undeclared_includes] modules. Split the builtin headers
tests out from the compiler_builtins test so that the testing modules
can be modified without affecting the other many tests that use
Inputs/System/usr/include.
show more ...
|
Revision tags: llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0 |
|
#
9a7a6dd3 |
| 07-Sep-2023 |
Ian Anderson <iana@apple.com> |
[Modules] Make clang modules for the C standard library headers
Make top level modules for all the C standard library headers.
The `__stddef` implementation headers need header guards now that they
[Modules] Make clang modules for the C standard library headers
Make top level modules for all the C standard library headers.
The `__stddef` implementation headers need header guards now that they're all modular. stdarg.h and stddef.h will be textual headers in the builtin modules, and so need to be repeatedly included in both the system and builtin module case. Define their header guards for consistency, but ignore them when building with modules.
`__stddef_null.h` needs to ignore its header guard when modules aren't being used to fulfill its redefinition obligation. `__stddef_nullptr_t.h` needs to add a guard for C23 so that `_Builtin_stddef` can compile in C17 and earlier modes. `_Builtin_stddef.nullptr_t` can't require C23 because it also needs to be usable from C++.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D159064
show more ...
|
#
7e8a0e4b |
| 29-Sep-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[NFC] [C++20] [Modules] Rename NamedModuleHasInit to NamedModuleHasInit
Address comments in https://github.com/llvm/llvm-project/pull/67638/files#r1340342453 to rename the field variable.
|
#
989173c0 |
| 28-Sep-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[C++20] [Modules] Don't generate call to an imported module that dont init anything (#67638)
Close https://github.com/llvm/llvm-project/issues/56794
And see https://github.com/llvm/llvm-project/i
[C++20] [Modules] Don't generate call to an imported module that dont init anything (#67638)
Close https://github.com/llvm/llvm-project/issues/56794
And see https://github.com/llvm/llvm-project/issues/67582 for a detailed
backgrond for the issue.
As required by the Itanium ABI, the module units have to generate the
initialization function. However, the importers are allowed to elide the
call to the initialization function if they are sure the initialization
function doesn't do anything.
This patch implemented this semantics.
show more ...
|
#
9744909a |
| 28-Sep-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[NFC] [C++20] [Modules] Refactor Module::getGlobalModuleFragment and Module::getPrivateModuleFragment
The original implementation of `Module::getGlobalModuleFragment` and `Module::getPrivateModuleFr
[NFC] [C++20] [Modules] Refactor Module::getGlobalModuleFragment and Module::getPrivateModuleFragment
The original implementation of `Module::getGlobalModuleFragment` and `Module::getPrivateModuleFragment` tried to find the global module fragment and the private module fragment by comparing strings, which smells bad. This patch tries to improve this.
show more ...
|
Revision tags: llvmorg-17.0.0-rc4 |
|
#
adb68c97 |
| 28-Aug-2023 |
Ian Anderson <iana@apple.com> |
[clang][modules] Add a c23 module feature
Add a c23 module feature for `requires`.
Reviewed By: ChuanqiXu, v.g.vassilev, aaron.ballman
Differential Revision: https://reviews.llvm.org/D159018
|
Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5 |
|
#
06611e36 |
| 26-May-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] Implement `PointerLikeTraits` for `{File,Directory}EntryRef`
This patch implements `llvm::PointerLikeTraits<FileEntryRef>` and `llvm::PointerLikeTraits<DirectoryEntryRef>`, allowing some sim
[clang] Implement `PointerLikeTraits` for `{File,Directory}EntryRef`
This patch implements `llvm::PointerLikeTraits<FileEntryRef>` and `llvm::PointerLikeTraits<DirectoryEntryRef>`, allowing some simplifications around umbrella header/directory code.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D154905
show more ...
|
#
b37233a2 |
| 12-Jun-2023 |
Iain Sandoe <iain@sandoe.co.uk> |
[C++20][Modules] Complete implementation of module.import p7.
The following test fails to compile TU b.cpp because we are not making the transitively imported modules visible (per [module.import]/p7
[C++20][Modules] Complete implementation of module.import p7.
The following test fails to compile TU b.cpp because we are not making the transitively imported modules visible (per [module.import]/p7)
``` a.cppm: export module a;
export int foo() { return 42; }
b.cppm: export module b; import a;
export int bar();
b.cpp: module b;
int bar() { return foo(); }
clang++ -c -std=c++2b -fmodule-output a.cppm clang++ -c -std=c++2b -fmodule-output -fprebuilt-module-path=. b.cppm clang++ -c -std=c++2b -fprebuilt-module-path=. b.cpp b.cpp:4:12: error: declaration of 'foo' must be imported from module 'a' before it is required return foo(); ```
This is fixed by the following patch (which also addresses a FIXME in basic.def.odr/p6.cppm).
Differential Revision: https://reviews.llvm.org/D152746
show more ...
|
#
fa5788ff |
| 31-May-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][index] NFCI: Make `CXFile` a `FileEntryRef`
This patch swaps out the `void *` behind `CXFile` from `FileEntry *` to `FileEntryRef::MapEntry *`. This allows us to remove some deprecated uses
[clang][index] NFCI: Make `CXFile` a `FileEntryRef`
This patch swaps out the `void *` behind `CXFile` from `FileEntry *` to `FileEntryRef::MapEntry *`. This allows us to remove some deprecated uses of `FileEntry::getName()`.
Depends on D151854.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151938
show more ...
|
#
e6830b60 |
| 31-May-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`
Most users of `Module::Header` already assume its `Entry` is populated. Enforce this assumption in the type system
[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`
Most users of `Module::Header` already assume its `Entry` is populated. Enforce this assumption in the type system and handle the only case where this is not the case by wrapping the whole struct in `std::optional`. Do the same for `Module::DirectoryName`.
Depends on D151584.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151586
show more ...
|
#
d6e617c8 |
| 26-May-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] NFCI: Use `DirectoryEntryRef` for umbrella directory
This removes some deprecated uses of `DirectoryEntry::getName()`.
Depends on D151581.
Differential Revision: https://reviews.l
[clang][modules] NFCI: Use `DirectoryEntryRef` for umbrella directory
This removes some deprecated uses of `DirectoryEntry::getName()`.
Depends on D151581.
Differential Revision: https://reviews.llvm.org/D151584
show more ...
|