History log of /llvm-project/clang/lib/Frontend/FrontendAction.cpp (Results 1 – 25 of 268)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 5c0aa31c 12-Jan-2025 Fangrui Song <i@maskray.me>

-ftime-report: Move FrontendTimer closer to TimeTraceScope

... to improve consistency and make "Clang time report" cover
`FrontendAction::BeginSourceFile` and `FrontendAction::EndSourceFile`.


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3
# 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 ...


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1
# 3cd3202b 24-Sep-2024 Kazu Hirata <kazu@google.com>

[Frontend] Teach LoadFromASTFile to take FileName by StringRef (NFC) (#109583)

Without this patch, several callers of LoadFromASTFile construct an
instance of std::string to be passed as FileName,

[Frontend] Teach LoadFromASTFile to take FileName by StringRef (NFC) (#109583)

Without this patch, several callers of LoadFromASTFile construct an
instance of std::string to be passed as FileName, only to be converted
back to StringRef when LoadFromASTFile calls ReadAST.

This patch changes the type of FileName to StringRef and updates the
callers.

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
# e74a34b6 13-May-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[NFC] [Serialization] Merge IdentID with IdentifierID

In ASTBitCodes.h, there are two type alias for the ID type of
Identifiers with the same underlying type. It is confusing. This patch
tries to me

[NFC] [Serialization] Merge IdentID with IdentifierID

In ASTBitCodes.h, there are two type alias for the ID type of
Identifiers with the same underlying type. It is confusing. This patch
tries to merge the `IdentID` to `IdentifierID` to erase such confusion.

show more ...


Revision tags: llvmorg-18.1.5
# 03b1a0c2 25-Apr-2024 yronglin <yronglin777@gmail.com>

[Clang] Diagnose apply AST consume actions on LLVM IR (#88602)

Fixes https://github.com/llvm/llvm-project/issues/88522

This PR introduce a new diagnostic to report apply AST consume actions
on L

[Clang] Diagnose apply AST consume actions on LLVM IR (#88602)

Fixes https://github.com/llvm/llvm-project/issues/88522

This PR introduce a new diagnostic to report apply AST consume actions
on LLVM IR.

---------

Signed-off-by: yronglin <yronglin777@gmail.com>

show more ...


# d86cc73b 25-Apr-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[NFC] [Serialization] Avoid using DeclID directly as much as possible

This patch tries to remove all the direct use of DeclID except the real
low level reading and writing. All the use of DeclID is

[NFC] [Serialization] Avoid using DeclID directly as much as possible

This patch tries to remove all the direct use of DeclID except the real
low level reading and writing. All the use of DeclID is converted to
the use of LocalDeclID or GlobalDeclID. This is helpful to increase the
readability and type safety.

show more ...


# 72b58146 25-Apr-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

Revert "[NFC] [Serialization] Avoid using DeclID directly as much as possible"

This reverts commit 42070a5c092ed420bf92ebf38229c594885e94c7.

I forgot to touch lldb.


# 42070a5c 25-Apr-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[NFC] [Serialization] Avoid using DeclID directly as much as possible

This patch tries to remove all the direct use of DeclID except the real
low level reading and writing. All the use of DeclID is

[NFC] [Serialization] Avoid using DeclID directly as much as possible

This patch tries to remove all the direct use of DeclID except the real
low level reading and writing. All the use of DeclID is converted to
the use of LocalDeclID or GlobalDeclID. This is helpful to increase the
readability and type safety.

show more ...


# c2a98fde 25-Apr-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[NFC] Move DeclID from serialization/ASTBitCodes.h to AST/DeclID.h (#89873)

Previously, the DeclID is defined in serialization/ASTBitCodes.h under
clang::serialization namespace. However, actually

[NFC] Move DeclID from serialization/ASTBitCodes.h to AST/DeclID.h (#89873)

Previously, the DeclID is defined in serialization/ASTBitCodes.h under
clang::serialization namespace. However, actually the DeclID is not
purely used in serialization part. The DeclID is already widely used in
AST and all around the clang project via classes like `LazyPtrDecl` or
calling `ExternalASTSource::getExernalDecl()`. All such uses are via the
raw underlying type of `DeclID` as `uint32_t`. This is not pretty good.

This patch moves the DeclID class family to a new header `AST/DeclID.h`
so that the whole project can use the wrapped class `DeclID`,
`GlobalDeclID` and `LocalDeclID` instead of the raw underlying type.
This can improve the readability and the type safety.

show more ...


Revision tags: 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, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 2e5af56b 23-Feb-2024 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[C++20] [Modules] Allow to compile a pcm with and without -fPIC
seperately

We can compile a module unit in 2 phase compilaton:

```
clang++ -std=c++20 a.cppm --precompile -o a.pcm
clang++ -std=c++20

[C++20] [Modules] Allow to compile a pcm with and without -fPIC
seperately

We can compile a module unit in 2 phase compilaton:

```
clang++ -std=c++20 a.cppm --precompile -o a.pcm
clang++ -std=c++20 a.pcm -c -o a.o
```

And it is a general requirement that we need to compile a translation
unit with and without -fPIC for static and shared libraries.

But for C++20 modules with 2 phase compilation, it may be waste of time
to compile them 2 times completely. It may be fine to generate one BMI
and compile it with and without -fPIC seperately.

e.g.,

```
clang++ -std=c++20 a.cppm --precompile -o a.pcm
clang++ -std=c++20 a.pcm -c -o a.o
clang++ -std=c++20 a.pcm -c -fPIC -o a-PIC.o
```

Then we can save the time to parse a.cppm repeatedly.

show more ...


Revision tags: llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 21361bb8 28-Nov-2023 Juergen Ributzka <juergen@ributzka.de>

[clang] Remove unused argument. NFC. (#73594)


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3
# 701d804c 08-Oct-2023 David Stone <davidfromonline@gmail.com>

[clang][Modules] `checkModuleIsAvailable` should use a const & parameter instead of pointer (#67902)

The `Module` parameter to `checkModuleIsAvailable` is currently passed
by pointer to non-const.

[clang][Modules] `checkModuleIsAvailable` should use a const & parameter instead of pointer (#67902)

The `Module` parameter to `checkModuleIsAvailable` is currently passed
by pointer to non-const. However, it requires only const access and it
cannot be null. Change this to be a reference to const instead.

This then makes it obvious that it is an input-only parameter, so move
it to be before the in-out parameter for diagnostics.

show more ...


Revision tags: 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.


# 3e9c3630 11-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFCI: Use `FileEntryRef` in `SourceManager::setFileIsTransient()`


# 1b07d432 10-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFCI: Use `FileEntryRef` in `ModuleMap::InferredModuleAllowedBy`


# 523c4712 08-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

Reapply "[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`"

This reapplies ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f, except for a tiny part that was reverted separately: 65331da0032ab4253a

Reapply "[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`"

This reapplies ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f, except for a tiny part that was reverted separately: 65331da0032ab4253a4bc0ddcb2da67664bd86a9. That will be reapplied later on, since it turned out to be more involved.

This commit is enabled by 5523fefb01c282c4cbcaf6314a9aaf658c6c145f and f0f548a65a215c450d956dbcedb03656449705b9, specifically the part that makes 'clang-tidy/checkers/misc/header-include-cycle.cpp' separator agnostic.

show more ...


# 869111cc 07-Sep-2023 Chuanqi Xu <yedeng.yd@linux.alibaba.com>

[NFC] [C++20] [Modules] Refactor the warning to '-fmodule-file=<BMIPath>' for C++20 modules

Previous implementation of the warning to use `-fmodule-file=<BMIPath>`
for C++20 Modules is not straightf

[NFC] [C++20] [Modules] Refactor the warning to '-fmodule-file=<BMIPath>' for C++20 modules

Previous implementation of the warning to use `-fmodule-file=<BMIPath>`
for C++20 Modules is not straightforward and it is problematic in case
we read the BMIPath by writing tools based clang components. This patch
refactors it with a simple and direct style.

show more ...


# 0a9611fd 06-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

Revert "[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`"

This reverts commit ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f.

The 'clang-tidy/checkers/misc/header-include-cycle.cpp' test start

Revert "[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`"

This reverts commit ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f.

The 'clang-tidy/checkers/misc/header-include-cycle.cpp' test started failing on Windows: https://lab.llvm.org/buildbot/#/builders/216/builds/26855.

show more ...


# ddbcc10b 06-Sep-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`

This commit replaces some calls to the deprecated `FileEntry::getName()` with `FileEntryRef::getName()` by swapping current usages of `Sou

[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`

This commit replaces some calls to the deprecated `FileEntry::getName()` with `FileEntryRef::getName()` by swapping current usages of `SourceManager::getFileEntryForID()` with `SourceManager::getFileEntryRefForID()`. This lowers the number of usages of the deprecated `FileEntry::getName()` from 95 to 50.

show more ...


Revision tags: llvmorg-17.0.0-rc4
# e257c0a9 28-Aug-2023 Younan Zhang <zyn7109@gmail.com>

[clang][clangd] Ensure the stack bottom before building AST

`clang::runWithSufficientStackSpace` requires the address of the
initial stack bottom to prevent potential stack overflows.

In addition,

[clang][clangd] Ensure the stack bottom before building AST

`clang::runWithSufficientStackSpace` requires the address of the
initial stack bottom to prevent potential stack overflows.

In addition, add a fallback to ASTFrontendAction in case any client
forgets to call it when not through CompilerInstance::ExecuteAction,
which is rare.

Fixes https://github.com/clangd/clangd/issues/1745.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D158967

show more ...


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1
# a623f4c7 28-Jul-2023 Podchishchaeva, Mariya <mariya.podchishchaeva@intel.com>

[NFC][clang] Fix static analyzer concerns

DelegatingDeserializationListener frees resources in the destructor but doesn't
have user-written copy c'tor or assignment operator, so copying it using
def

[NFC][clang] Fix static analyzer concerns

DelegatingDeserializationListener frees resources in the destructor but doesn't
have user-written copy c'tor or assignment operator, so copying it using
default ones can cause double free.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D156405

show more ...


Revision tags: llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5
# 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 ...


# 3473f728 31-May-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile

This patch changes the argument type to `HeaderSearch::LookupFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in orde

[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile

This patch changes the argument type to `HeaderSearch::LookupFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove some calls to the deprecated `DirectoryEntry::getName()`.

Depends on D127660.

Reviewed By: bnbarham, benlangmuir

Differential Revision: https://reviews.llvm.org/D127663

show more ...


1234567891011