================
@@ -118,19 +118,20 @@ void ExternalASTSource::FindExternalLexicalDecls(
void ExternalASTSource::getMemoryBufferSizes(MemoryBufferSizes &sizes) const {}
uint32_t ExternalASTSource::incrementGeneration(ASTContext &C) {
- uint32_t OldGeneration = CurrentGeneration;
-
// Make sure the generation of the topmost external source for the context is
// incremented. That might not be us.
auto *P = C.getExternalSource();
- if (P && P != this)
+ if (P && P != this) {
+ // The call itself returns the OldGeneration of the topmost external
source.
CurrentGeneration = P->incrementGeneration(C);
- else {
- // FIXME: Only bump the generation counter if the current generation number
- // has been observed?
- if (!++CurrentGeneration)
- llvm::reportFatalUsageError("generation counter overflowed");
}
+ uint32_t OldGeneration = CurrentGeneration;
+
+ // FIXME: Only bump the generation counter if the current generation number
+ // has been observed?
+ if (!++CurrentGeneration)
----------------
hahnjo wrote:
In principle, I would agree but please note that this code is only moved. Since
this patch is to be backported (downstream, maybe even upstream for LLVM 23?),
I would like to keep it to the point.
https://github.com/llvm/llvm-project/pull/219189
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits