[all-commits] [llvm/llvm-project] d49052: [clangd] [Modules] Fixes to correctly handle modul...
fleeting-xx via All-commits
all-commits at lists.llvm.org
Thu May 29 23:46:09 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d490526a81586c7b2fe674ce520276570c9881e2
https://github.com/llvm/llvm-project/commit/d490526a81586c7b2fe674ce520276570c9881e2
Author: fleeting-xx <bakerdt at gmail.com>
Date: 2025-05-30 (Fri, 30 May 2025)
Changed paths:
M clang-tools-extra/clangd/ModulesBuilder.cpp
A clang-tools-extra/clangd/test/module_dependencies.test
M clang-tools-extra/clangd/test/modules.test
Log Message:
-----------
[clangd] [Modules] Fixes to correctly handle module dependencies (#142090)
Simple module import dependencies, see
[module_dependencies.test](https://github.com/llvm/llvm-project/compare/main...fleeting-xx:llvm-project:fix_clangd_dependent_modules#diff-5510681cbe5b7ed3a72c5e683184e83fa66e911e9abb0e6670b01b87b3ca7b1a),
were not being correctly handled due to a couple of issues.
- The `MDB.getRequiredModules()` call returned a
`std::vector<std::string>` and all `StringRefs` were to entries in that
temporary value. So the `StringRef` elements in
`getAllRequiredModules()`'s return value were bound to values that went
out of scope.
- `ModulesBuilder::ModulesBuilderImpl::getOrBuildModuleFile()` was
iterating over each module dependency name, but only using the original
module name and path for various checks and module compilation.
In addition to fixing the above issues I added support for Windows paths
in modules.test and added a new unit test, module_dependencies.test,
which demonstrates the failure in the previous state and works correctly
after the fixes have been applied.
Please let me know if I've missed anything.
Co-authored-by: Dan Baker <dan at requires.coffee>
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