Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4 |
|
#
76427594 |
| 16-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[Lex] Remove unused includes (NFC) (#116460)
Identified with misc-include-cleaner.
|
Revision tags: llvmorg-19.1.3 |
|
#
19131c7f |
| 28-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules][lldb] Fix build after #113391
Instead of changing the return type of `ModuleMap::findOrCreateModule`, this patch adds a counterpart that only returns `Module *` and thus has the sam
[clang][modules][lldb] Fix build after #113391
Instead of changing the return type of `ModuleMap::findOrCreateModule`, this patch adds a counterpart that only returns `Module *` and thus has the same signature as `createModule()`, which is important in `ASTReader`.
show more ...
|
#
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 ...
|
#
da1a16ae |
| 28-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Preserve the module map that allowed inferring (#113389)
With inferred modules, the dependency scanner takes care to replace the
fake "__inferred_module.map" path with the file tha
[clang][modules] Preserve the module map that allowed inferring (#113389)
With inferred modules, the dependency scanner takes care to replace the
fake "__inferred_module.map" path with the file that allowed the module
to be inferred. However, this only worked when such a module was
imported directly in the TU. Whenever such module got loaded
transitively, the scanner would fail to perform the replacement. This is
caused by the fact that PCM files are lossy and drop this information.
This patch makes sure that PCMs include this file for each submodule (in
the `SUBMODULE_DEFINITION` record), fixes one existing test with an
incorrect assertion, and does a little drive-by refactoring of
`ModuleMap`.
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 ...
|
#
4dd55c56 |
| 24-Oct-2024 |
Jay Foad <jay.foad@amd.com> |
[clang] Use {} instead of std::nullopt to initialize empty ArrayRef (#109399)
Follow up to #109133.
|
#
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 |
|
#
b1aea98c |
| 25-Sep-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] Make deprecations of some `FileManager` APIs formal (#110014)
Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are doc
[clang] Make deprecations of some `FileManager` APIs formal (#110014)
Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are documented to be
deprecated, but don't have the attribute that warns on their usage. This
PR marks them as such with `LLVM_DEPRECATED()` and replaces their usage
with the recommended counterparts. NFCI.
show more ...
|
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, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3 |
|
#
44af53b2 |
| 28-Mar-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Avoid calling expensive `SourceManager::translateFile()` (#86216)
The `ASTWriter` algorithm for computing affecting module maps uses
`SourceManager::translateFile()` to get a `File
[clang][modules] Avoid calling expensive `SourceManager::translateFile()` (#86216)
The `ASTWriter` algorithm for computing affecting module maps uses
`SourceManager::translateFile()` to get a `FileID` from a `FileEntry`.
This is slow (O(n)) since the function performs a linear walk over
`SLocEntries` until it finds one with a matching `FileEntry`.
This patch removes this use of `SourceManager::translateFile()` by
tracking `FileID` instead of `FileEntry` in couple of places in
`ModuleMap`, giving `ASTWriter` the desired `FileID` directly. There are
no changes required for clients that still want a `FileEntry` from
`ModuleMap`: the existing APIs internally use `SourceManager` to perform
the reverse `FileID` to `FileEntry` conversion in O(1).
show more ...
|
Revision tags: 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, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
9b2c25c7 |
| 21-Jan-2024 |
Kazu Hirata <kazu@google.com> |
[clang] Use SmallString::operator std::string (NFC)
|
#
f4bc70e8 |
| 08-Jan-2024 |
Juergen Ributzka <juergen@ributzka.de> |
[clang][modules] Remove `_Private` suffix from framework auto-link hints. (#77120)
- [clang][modules] Remove no longer needed autolink test for TBD files.
- [clang][modules] Remove `_Private` suffi
[clang][modules] Remove `_Private` suffix from framework auto-link hints. (#77120)
- [clang][modules] Remove no longer needed autolink test for TBD files.
- [clang][modules] Remove `_Private` suffix from framework auto-link
hints.
show more ...
|
#
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 ...
|
#
0cb0a48c |
| 09-Dec-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] NFC: Remove `OptionalFileEntryRefDegradesToFileEntryPtr` (#74899)
|
Revision tags: llvmorg-17.0.6 |
|
#
cf1bde33 |
| 24-Nov-2023 |
Tulio Magno Quites Machado Filho <tuliom@redhat.com> |
[clang] Fix sorting module headers (#73146)
Struct Module::Header is not a POD type. As such, qsort() and
llvm::array_pod_sort() must not be used to sort it. This became an issue
with the new impl
[clang] Fix sorting module headers (#73146)
Struct Module::Header is not a POD type. As such, qsort() and
llvm::array_pod_sort() must not be used to sort it. This became an issue
with the new implementation of qsort() in glibc 2.39 that is not
guaranteed to be a stable sort, causing Headers to be re-ordered and
corrupted.
Replace the usage of llvm::array_pod_sort() with std::stable_sort() in
order to fix this issue. The signature of compareModuleHeaders() has to
be modified.
Fixes #73145.
show more ...
|
Revision tags: llvmorg-17.0.5 |
|
#
0f7aaeb3 |
| 09-Nov-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[C++20] [Modules] Allow export from language linkage
Close https://github.com/llvm/llvm-project/issues/71347
Previously I misread the concept of module purview. I thought if a declaration attached
[C++20] [Modules] Allow export from language linkage
Close https://github.com/llvm/llvm-project/issues/71347
Previously I misread the concept of module purview. I thought if a declaration attached to a unnamed module, it can't be part of the module purview. But after the issue report, I recognized that module purview is more of a concept about locations instead of semantics.
Concretely, the things in the language linkage after module declarations can be exported.
This patch refactors `Module::isModulePurview()` and introduces some possible code cleanups.
show more ...
|
Revision tags: llvmorg-17.0.4 |
|
#
396b5621 |
| 27-Oct-2023 |
Richard Howell <rmaz@users.noreply.github.com> |
[clang] use relative paths for builtin headers during module compilation (#68023)
When including builtin headers as part of a system module, ensure we use
relative paths to those headers. Otherwise
[clang] use relative paths for builtin headers during module compilation (#68023)
When including builtin headers as part of a system module, ensure we use
relative paths to those headers. Otherwise the module will fail to compile
when specifying relative resource directories without extra search paths.
show more ...
|
#
09ec0004 |
| 20-Oct-2023 |
Ian Anderson <iana@apple.com> |
[Modules] textual headers in submodules never resolve their `use`s (#69651)
When an include from a textual header is resolved, the textual header's
submodule is used as the requesting module. The s
[Modules] textual headers in submodules never resolve their `use`s (#69651)
When an include from a textual header is resolved, the textual header's
submodule is used as the requesting module. The submodule's uses are
resolved, but that doesn't work because only top level modules have
uses, and only the top level module uses are used for checking uses in
Module::directlyUses. ModuleMap::resolveUses to resolve the top level
module instead of the submodule.
show more ...
|
#
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 |
|
#
06a05f33 |
| 03-Oct-2023 |
David Stone <davidfromonline@gmail.com> |
[NFC] remove duplicate ModuleId alias (#67899)
[clang] Remove duplicate `ModuleId` alias
|
Revision tags: llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0 |
|
#
12866a2b |
| 09-Sep-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Use `FileEntryRef` in `ModuleMap` (2/2)
|
#
12cb98fe |
| 09-Sep-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Use `FileEntryRef` in `ModuleMap` (1/2)
|
#
0ea3d88b |
| 07-Sep-2023 |
Ian Anderson <iana@apple.com> |
[Modules] Add a flag to control builtin headers being in system modules
Including select builtin headers in system modules is a workaround for module cycles, primarily in Apple's Darwin module that
[Modules] Add a flag to control builtin headers being in system modules
Including select builtin headers in system modules is a workaround for module cycles, primarily in Apple's Darwin module that includes all of its C standard library headers. The workaround is problematic because it doesn't include all of the builtin headers (inttypes.h is notably absent), and it also doesn't include C++ headers. The straightforward for for this is to make top level modules for all of the C standard library headers and unwind.h in C++, clang, and the OS.
However, doing so in clang before the OS modules are ready re-introduces the module cycles. Add a -fbuiltin-headers-in-system-modules option to control if the special builtin headers belong to system modules or builtin modules. Pass the option by default for Apple.
Reviewed By: ChuanqiXu, Bigcheese, benlangmuir
Differential Revision: https://reviews.llvm.org/D159483
show more ...
|
#
1b07d432 |
| 10-Sep-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] NFCI: Use `FileEntryRef` in `ModuleMap::InferredModuleAllowedBy`
|