| Issue |
63346
|
| Summary |
Incorrect include-what-you-use (IWYU) mappings file for libcxx 16
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
percona-ysorokin
|
`libcxx/include/libcxx.imp` IWYU mappings file has several incorrect entries referring non-existing `#include <>` files:
* `<fwd>`
https://github.com/llvm/llvm-project/blob/7cbf1a2591520c2491aa35339f227775f4d3adf6/libcxx/include/libcxx.imp#L30
* `<debug_utils>`
https://github.com/llvm/llvm-project/blob/7cbf1a2591520c2491aa35339f227775f4d3adf6/libcxx/include/libcxx.imp#L25
* `<support>`
https://github.com/llvm/llvm-project/blob/7cbf1a2591520c2491aa35339f227775f4d3adf6/libcxx/include/libcxx.imp#L39
I suggest the following mappings for `__fwd/*`:
```diff
diff --git a/libcxx_clang16.imp b/libcxx_clang16_fixed.imp
index 575ce0f..f818891 100644
--- a/libcxx_clang16.imp
+++ b/libcxx_clang16_fixed.imp
@@ -27,7 +27,16 @@
{ include: [ "@<__filesystem/.*>", "private", "<filesystem>", "public" ] },
{ include: [ "@<__format/.*>", "private", "<format>", "public" ] },
{ include: [ "@<__functional/.*>", "private", "<functional>", "public" ] },
- { include: [ "@<__fwd/.*>", "private", "<fwd>", "public" ] },
+ { include: [ "<__fwd/array.h>", "private", "<array>", "public" ] },
+ { include: [ "<__fwd/get.h>", "private", "<tuple>", "public" ] },
+ { include: [ "<__fwd/hash.h>", "private", "<functional>", "public" ] },
+ { include: [ "<__fwd/memory_resource.h>", "private", "<memory_resource>", "public" ] },
+ { include: [ "<__fwd/pair.h>", "private", "<utility>", "public" ] },
+ { include: [ "<__fwd/span.h>", "private", "<span>", "public" ] },
+ { include: [ "<__fwd/string.h>", "private", "<string>", "public" ] },
+ { include: [ "<__fwd/string_view.h>", "private", "<string_view>", "public" ] },
+ { include: [ "<__fwd/subrange.h>", "private", "<ranges>", "public" ] },
+ { include: [ "<__fwd/tuple.h>", "private", "<tuple>", "public" ] },
{ include: [ "@<__ios/.*>", "private", "<ios>", "public" ] },
{ include: [ "@<__iterator/.*>", "private", "<iterator>", "public" ] },
{ include: [ "@<__memory/.*>", "private", "<memory>", "public" ] },
```
`__debug_utils/*` has only one file `randomize_range.h`, which is used only in 3 algorithms: `std::partial_sort`, `std::nth_element` and `std::sort`, so most probably `__debug_utils/randomize_range.h` should be mapped to `<algorithm>`.
`__support/*` are included either from `__locale` or from `__threading support`, so public headers for them should be either `<thread>` (for `__support_ibm_nanosleep.h`) or `<locale>` (for everything else).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs