[all-commits] [llvm/llvm-project] a9e249: [C++20][Modules][Serialization] Delay marking pend...
Michael Park via All-commits
all-commits at lists.llvm.org
Mon Feb 3 11:22:24 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a9e249f64e800fbb20a3b26c0cfb68c1a1aee5e1
https://github.com/llvm/llvm-project/commit/a9e249f64e800fbb20a3b26c0cfb68c1a1aee5e1
Author: Michael Park <mcypark at gmail.com>
Date: 2025-02-03 (Mon, 03 Feb 2025)
Changed paths:
M clang/lib/Serialization/ASTReader.cpp
A clang/test/Modules/pr121245.cpp
Log Message:
-----------
[C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (#121245)
The call to `hasBody` inside `finishPendingActions` that bumps the `PendingIncompleteDeclChains`
size from `0` to `1`, and also sets the `LazyVal->LastGeneration` to `6` which matches
the `LazyVal->ExternalSource->getGeneration()` value of `6`. Later, the iterations over `redecls()`
(which calls `getNextRedeclaration`) is expected to trigger the reload, but it **does not** since
the generation numbers match.
The proposed solution is to perform the marking of incomplete decl chains at the end of `finishPendingActions`.
This way, **all** of the incomplete decls are marked incomplete as a post-condition of `finishPendingActions`.
It's also safe to delay this operation since any operation being done within `finishPendingActions` has
`NumCurrentElementsDeserializing == 1`, which means that any calls to `CompleteDeclChain` would simply
add to the `PendingIncompleteDeclChains` without doing anything anyway.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list