diff options
author | fleeting-xx <bakerdt@gmail.com> | 2025-05-30 01:45:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-30 14:45:47 +0800 |
commit | d490526a81586c7b2fe674ce520276570c9881e2 (patch) | |
tree | c1636789273af155f9e84508be0a4e6e9b0bfb31 /clang/lib/Frontend/TestModuleFileExtension.cpp | |
parent | 2e82a17f4e71a833cc3ca4a832bd14a5ef537616 (diff) | |
download | llvm-d490526a81586c7b2fe674ce520276570c9881e2.zip llvm-d490526a81586c7b2fe674ce520276570c9881e2.tar.gz llvm-d490526a81586c7b2fe674ce520276570c9881e2.tar.bz2 |
[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@requires.coffee>
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions