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.
|
#
e494e269 |
| 31-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][lex] Remove `HeaderFileInfo::Framework` (#114460)
This PR removes the `HeaderFileInfo::Framework` member and reduces the
size of this data type from 32B to 16B. This should improve Clang's
[clang][lex] Remove `HeaderFileInfo::Framework` (#114460)
This PR removes the `HeaderFileInfo::Framework` member and reduces the
size of this data type from 32B to 16B. This should improve Clang's
memory usage in situations where it keeps track of lots of header files.
NFCI. Depends on #114459.
show more ...
|
#
19b4f17d |
| 31-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][lex] Remove `-index-header-map` (#114459)
This PR removes the `-index-header-map` functionality from Clang. AFAIK
this was only used internally at Apple and is now dead code. The main
moti
[clang][lex] Remove `-index-header-map` (#114459)
This PR removes the `-index-header-map` functionality from Clang. AFAIK
this was only used internally at Apple and is now dead code. The main
motivation behind this change is to enable the removal of
`HeaderFileInfo::Framework` member and reducing the size of that data
structure.
rdar://84036149
show more ...
|
Revision tags: llvmorg-19.1.3 |
|
#
590b1e31 |
| 25-Oct-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Only serialize info for locally-included headers (#113718)
I noticed that some PCM files contain `HeaderFileInfo` for headers only
included in a dependent PCM file, which is wastef
[clang][modules] Only serialize info for locally-included headers (#113718)
I noticed that some PCM files contain `HeaderFileInfo` for headers only
included in a dependent PCM file, which is wasteful.
This patch changes the logic to only write headers that are included
locally. This makes the PCM files smaller and saves some superfluous
deserialization of `HeaderFileInfo` triggered by
`Preprocessor::alreadyIncluded()`.
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 |
|
#
17dc43d6 |
| 13-Aug-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] Stop adjusting the module cache path (#102540)
This patch stops adjustments of the module cache path beyond what is
done in `ParseHeaderSearchArgs` (making it absolute and removing dots).
[clang] Stop adjusting the module cache path (#102540)
This patch stops adjustments of the module cache path beyond what is
done in `ParseHeaderSearchArgs` (making it absolute and removing dots).
This enables more efficient implementation of the caching VFS in
https://github.com/llvm/llvm-project/pull/88800.
show more ...
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1 |
|
#
cbd5ba20 |
| 23-Jul-2024 |
Volodymyr Sapsai <vsapsai@apple.com> |
[Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (#100005)
Such searches can be costly and non-intuitive. We've seen complaints
from dev
[Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (#100005)
Such searches can be costly and non-intuitive. We've seen complaints
from developers that they don't expect clang to find modules on their
own and not in search paths that developers provide. Keeping the search
of modulemaps in subdirectories for code completion as it provides
better user experience.
If you are defining module "UsefulCode" in
"include/UnrelatedName/module.modulemap", it is recommended to rename
the directory "UnrelatedName" to "UsefulCode". If you cannot do so, you
can add to "include/module.modulemap" a line like `extern module
UsefulCode "UnrelatedName/module.modulemap"`, so clang can find module
"UsefulCode" without checking each subdirectory in "include/".
rdar://106677321
---------
Co-authored-by: Jan Svoboda <jan@svoboda.ai>
show more ...
|
Revision tags: llvmorg-20-init |
|
#
12c0281f |
| 21-Jun-2024 |
Fangrui Song <i@maskray.me> |
[Lex] Replace hash_combine with a stable hash
|
#
da2ad441 |
| 20-Jun-2024 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[HeaderSearch] Introduce LazyIdentifierInfoPtr for Controlling Macro in HeaderFileInfo
This patch is helpful to reduce 32 bits for HeaderFileInfo by combining a uint32_t and pointer into a tagged po
[HeaderSearch] Introduce LazyIdentifierInfoPtr for Controlling Macro in HeaderFileInfo
This patch is helpful to reduce 32 bits for HeaderFileInfo by combining a uint32_t and pointer into a tagged pointer.
This is reviewed as part of https://github.com/llvm/llvm-project/pull/92085 and required to be split as a separate commit
show more ...
|
Revision tags: llvmorg-18.1.8 |
|
#
29b0d575 |
| 15-Jun-2024 |
Ian Anderson <iana@apple.com> |
[clang][modules] HeaderSearch::MarkFileModuleHeader sets textual headers' HeaderFileInfo non-external when it shouldn't (#89005)
HeaderSearch::MarkFileModuleHeader is no longer properly checking for
[clang][modules] HeaderSearch::MarkFileModuleHeader sets textual headers' HeaderFileInfo non-external when it shouldn't (#89005)
HeaderSearch::MarkFileModuleHeader is no longer properly checking for
no-changes, and so sets the HeaderFileInfo for every `textual header` to
non-external.
show more ...
|
#
8e0ba084 |
| 14-Jun-2024 |
kadir çetinkaya <kadircet@google.com> |
[clang][HeaderSearch] Fix handling of relative file-paths in suggestPathToFileForDiagnostics (#95121)
Normalize header-to-be-spelled using WorkingDir, similar to search paths
themselves.
Address
[clang][HeaderSearch] Fix handling of relative file-paths in suggestPathToFileForDiagnostics (#95121)
Normalize header-to-be-spelled using WorkingDir, similar to search paths
themselves.
Addresses https://github.com/llvm/llvm-project/issues/81215.
show more ...
|
Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5 |
|
#
d609029d |
| 24-Apr-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Allow module maps with textual headers to be non-affecting (#89441)
When writing out a PCM, we skip serializing headers' `HeaderFileInfo`
struct whenever this condition evaluates t
[clang][modules] Allow module maps with textual headers to be non-affecting (#89441)
When writing out a PCM, we skip serializing headers' `HeaderFileInfo`
struct whenever this condition evaluates to `true`:
```c++
!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader)
```
However, when Clang parses a module map file, each textual header gets a
`HFI` with `isModuleHeader=false`, `isTextualModuleHeader=true` and
`isCompilingModuleHeader=false`. This means the condition evaluates to
`false` even if the header was never included and the module map did not
affect the compilation. Each PCM file that happened to parse such module
map then contains a copy of the `HeaderFileInfo` struct for all textual
headers, and considers the containing module map affecting.
This patch makes it so that we skip headers that have not been included,
essentially removing the virality of textual headers when it comes to
PCM serialization.
show more ...
|
Revision tags: llvmorg-18.1.4 |
|
#
84df7a09 |
| 11-Apr-2024 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (#87848)
Clang uses the `HeaderFileInfo` struct to track bits of information on
header files, which gets used throughout t
[clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (#87848)
Clang uses the `HeaderFileInfo` struct to track bits of information on
header files, which gets used throughout the compiler. We also use this
to compute the set of affecting module maps in `ASTWriter` and in the
end serialize the information into the `HEADER_SEARCH_TABLE` record of a
PCM file, allowing clients to learn about headers from the module. In
doing so, Clang asks for existing `HeaderFileInfo` for all known
`FileEntries`. Note that this asks the loaded PCM files for the
information they have on each header file in question. This seems
unnecessary: we only want to serialize information on header files that
either belong to the current module or that got included textually.
Loaded PCM files can't provide us with any useful information.
For explicit modules with lazy loading (using `-fmodule-map-file=<path>`
with `-fmodule-file=<name>=<path>`) the compiler knows about header
files listed in the module map files on the command-line. This can be a
large number.
Asking for existing `HeaderFileInfo` can trigger deserialization of
`HEADER_SEARCH_TABLE` from loaded PCM files. Keys of the on-disk hash
table consist of the header file size and modification time. However,
with explicit modules Clang zeroes out the modification time. Moreover,
if you import lots of modules, some of their header files end up having
identical sizes. This means lots of hash collisions that can only be
resolved by running the serialized filename through `FileManager` and
comparing equality of the `FileEntry`. This ends up being super
expensive, essentially re-stating lots of the transitively loaded SDK
header files.
This patch cleans up the API for getting `HeaderFileInfo` and makes sure
`ASTWriter` uses the version that doesn't ask loaded PCM files for more
information. This removes the excessive stat traffic coming from
`ASTWriter` hopefully without changing observable behavior.
show more ...
|
#
fca51911 |
| 11-Apr-2024 |
Bill Wendling <5993918+bwendling@users.noreply.github.com> |
[NFC][Clang] Improve const correctness for IdentifierInfo (#79365)
The IdentifierInfo isn't typically modified. Use 'const' wherever
possible.
|
#
0cd0aa02 |
| 05-Apr-2024 |
Ian Anderson <iana@apple.com> |
[clang][modules] Headers meant to be included multiple times can be completely invisible in clang module builds (#83660)
Once a file has been `#import`'ed, it gets stamped as if it was `#pragma
onc
[clang][modules] Headers meant to be included multiple times can be completely invisible in clang module builds (#83660)
Once a file has been `#import`'ed, it gets stamped as if it was `#pragma
once` and will not be re-entered, even on #include. This means that any
errant #import of a file designed to be included multiple times, such as
<assert.h>, will incorrectly mark it as include-once and break the
multiple include functionality. Normally this isn't a big problem, e.g.
<assert.h> can't have its NDEBUG mode changed after the first #import,
but it is still mostly functional. However, when clang modules are
involved, this can cause the header to be hidden entirely.
Objective-C code most often uses #import for everything, because it's
required for most Objective-C headers to prevent double inclusion and
redeclaration errors. (It's rare for Objective-C headers to use macro
guards or `#pragma once`.) The problem arises when a submodule includes
a multiple-include header. The "already included" state is global across
all modules (which is necessary so that non-modular headers don't get
compiled into multiple translation units and cause redeclaration
errors). If another module or the main file #import's the same header,
it becomes invisible from then on. If the original submodule is not
imported, the include of the header will effectively do nothing and the
header will be invisible. The only way to actually get the header's
declarations is to somehow figure out which submodule consumed the
header, and import that instead. That's basically impossible since it
depends on exactly which modules were built in which order.
#import is a poor indicator of whether a header is actually
include-once, as the #import is external to the header it applies to,
and requires that all inclusions correctly and consistently use #import
vs #include. When modules are enabled, consider a header marked
`textual` in its module as a stronger indicator of multiple-include than
#import's indication of include-once. This will allow headers like
<assert.h> to always be included when modules are enabled, even if
#import is erroneously used somewhere.
show more ...
|
Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2 |
|
#
7847e445 |
| 30-Jan-2024 |
Michael Spencer <bigcheesegs@gmail.com> |
[clang][DependencyScanner] Remove unused -ivfsoverlay files (#73734)
`-ivfsoverlay` files are unused when building most modules. Enable
removing them by,
* adding a way to visit the filesystem tre
[clang][DependencyScanner] Remove unused -ivfsoverlay files (#73734)
`-ivfsoverlay` files are unused when building most modules. Enable
removing them by,
* adding a way to visit the filesystem tree with extensible RTTI to
access each `RedirectingFileSystem`.
* Adding tracking to `RedirectingFileSystem` to record when it
actually redirects a file access.
* Storing this information in each PCM.
Usage tracking is only enabled when iterating over the source manager
and affecting modulemaps. Here each path is stated to cause an access.
During scanning these stats all hit the cache.
show more ...
|
Revision tags: llvmorg-18.1.0-rc1 |
|
#
549bee8a |
| 25-Jan-2024 |
gulfemsavrun <gulfem@google.com> |
Revert "[Modules] [HeaderSearch] Don't reenter headers if it is pragm… (#79396)
…a once (#76119)"
This reverts commit f0c387038854d61a632520a4073d1b6ebf4997ed because it
causes an lldb test to
Revert "[Modules] [HeaderSearch] Don't reenter headers if it is pragm… (#79396)
…a once (#76119)"
This reverts commit f0c387038854d61a632520a4073d1b6ebf4997ed because it
causes an lldb test to fail on a missing import on Mac.
https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8758053465398947297/+/u/lldb/test/stdout
show more ...
|
Revision tags: llvmorg-19-init |
|
#
f0c38703 |
| 24-Jan-2024 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[Modules] [HeaderSearch] Don't reenter headers if it is pragma once (#76119)
Close https://github.com/llvm/llvm-project/issues/73023
The direct issue of https://github.com/llvm/llvm-project/issu
[Modules] [HeaderSearch] Don't reenter headers if it is pragma once (#76119)
Close https://github.com/llvm/llvm-project/issues/73023
The direct issue of https://github.com/llvm/llvm-project/issues/73023 is
that we entered a header which is marked as pragma once since the
compiler think it is OK if there is controlling macro.
It doesn't make sense. I feel like it should be sufficient to skip it
after we see the '#pragma once'.
From the context, it looks like the workaround is primarily for
ObjectiveC. So we might need reviewers from OC.
show more ...
|
#
395f9ce3 |
| 16-Dec-2023 |
Kazu Hirata <kazu@google.com> |
Use StringRef::{starts,ends}_with (NFC)
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with
Use StringRef::{starts,ends}_with (NFC)
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 ...
|
#
a171d248 |
| 14-Dec-2023 |
Michael Spencer <bigcheesegs@gmail.com> |
[clang][modules] Deprecate module.map in favor of module.modulemap (#75142)
This patch deprecates `module.map` in favor of `module.modulemap`, which
has been the preferred form since 2014. The even
[clang][modules] Deprecate module.map in favor of module.modulemap (#75142)
This patch deprecates `module.map` in favor of `module.modulemap`, which
has been the preferred form since 2014. The eventual goal is to remove
support for `module.map` to reduce the number of stats Clang needs to do
while searching for module map files.
This patch touches a lot of files, but the majority of them are just
renaming tests or references to the file in comments or documentation.
The relevant files are:
* lib/Lex/HeaderSearch.cpp
* include/clang/Basic/DiagnosticGroups.td
* include/clang/Basic/DiagnosticLexKinds.td
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 ...
|
#
3293c088 |
| 07-Dec-2023 |
Aaron Ballman <aaron@aaronballman.com> |
Remove dead code; NFC
This code was added 17 years ago but never enabled or tested. GCC warns that -I- is deprecated for them, and Clang gives an error when passed -I-, so we may as well remove this
Remove dead code; NFC
This code was added 17 years ago but never enabled or tested. GCC warns that -I- is deprecated for them, and Clang gives an error when passed -I-, so we may as well remove this code rather than hook it up to the driver and maintain it.
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, 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, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0 |
|
#
b0abc9dd |
| 11-Sep-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang] NFCI: Use `FileEntryRef` in `ASTReader::GetHeaderFileInfo()`
This is the `ASTReader` counterpart to PR #67383.
|
#
12866a2b |
| 09-Sep-2023 |
Jan Svoboda <jan_svoboda@apple.com> |
[clang][modules] Use `FileEntryRef` in `ModuleMap` (2/2)
|