[all-commits] [llvm/llvm-project] 245da0: [modules] Fix callback argument thinko
Nathan Sidwell via All-commits
all-commits at lists.llvm.org
Mon Oct 17 09:31:06 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 245da0a451e193dc4229ed8aed28cf34fa083ed4
https://github.com/llvm/llvm-project/commit/245da0a451e193dc4229ed8aed28cf34fa083ed4
Author: Nathan Sidwell <nathan at acm.org>
Date: 2022-10-17 (Mon, 17 Oct 2022)
Changed paths:
M clang/lib/Basic/Module.cpp
Log Message:
-----------
[modules] Fix callback argument thinko
VisbleModuleSet::setVisible takes a callback, to inform of modules
being made (transitively) visible. However, we were calling it as
'Vis(M)' from a recursive lambda, where 'M' is a capture of
setVisible's M, module parameter. Thus we can invoke the callback
multiple times, passing the same value to it each time.
Everywhere else in the lambda, we refer to V.M of the lambda's
Visiting parameter. We should be doing so for the callback. Thus
we'll pass the outermost module on the outermost recursive call, and
as we descend the imports, we'll pass each import to the callback.
Reviewed By: iains
Differential Revision: https://reviews.llvm.org/D135958
More information about the All-commits
mailing list