mapping.imp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. [
  2. # https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md
  3. # C++ alternatives to C standard headers
  4. { include: [ "<assert.h>", public, "<cassert>", public ] },
  5. { include: [ "<complex.h>", public, "<ccomplex>", public ] },
  6. { include: [ "<ctype.h>", public, "<cctype>", public ] },
  7. { include: [ "<errno.h>", public, "<cerrno>", public ] },
  8. { include: [ "<float.h>", public, "<cfloat>", public ] },
  9. { include: [ "<iso646.h>", public, "<ciso646>", public ] },
  10. { include: [ "<limits.h>", public, "<climits>", public ] },
  11. { include: [ "<locale.h>", public, "<clocale>", public ] },
  12. { include: [ "<math.h>", public, "<cmath>", public ] },
  13. { include: [ "<setjmp.h>", public, "<csetjmp>", public ] },
  14. { include: [ "<signal.h>", public, "<csignal>", public ] },
  15. { include: [ "<stdarg.h>", public, "<cstdarg>", public ] },
  16. { include: [ "<stddef.h>", public, "<cstddef>", public ] },
  17. { include: [ "<stdio.h>", public, "<cstdio>", public ] },
  18. { include: [ "<stdlib.h>", public, "<cstdlib>", public ] },
  19. { include: [ "<string.h>", public, "<cstring>", public ] },
  20. { include: [ "<time.h>", public, "<ctime>", public ] },
  21. { include: [ "<wchar.h>", public, "<cwchar>", public ] },
  22. { include: [ "<wctype.h>", public, "<cwctype>", public ] },
  23. # HACK: check whether this can be removed with next iwyu release.
  24. { include: [ "<bits/cxxabi_forced.h>", private, "<ctime>", public ] },
  25. { include: [ "<bits/chrono.h>", private, "<chrono>", public ] },
  26. { include: [ "<bits/exception.h>", private, "<exception>", public ] },
  27. { include: [ "<bits/shared_ptr.h>", private, "<memory>", public ] },
  28. { include: [ "<bits/std_function.h>", private, "<functional>", public ] },
  29. { include: [ "<bits/refwrap.h>", private, "<functional>", public ] },
  30. { include: [ "<bits/std_abs.h>", private, "<stdlib.h>", public ] },
  31. { include: [ "<bits/stdint-intn.h>", private, "<stdint.h>", public ] },
  32. { include: [ "<bits/stdint-uintn.h>", private, "<stdint.h>", public ] },
  33. { include: [ "<bits/string_view.tcc>", private, "<string_view>", public ] },
  34. { include: [ "<bits/time.h>", private, "<time.h>", public ] },
  35. { include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] },
  36. { include: [ "<bits/types/mbstate_t.h>", private, "<wchar.h>", public ] },
  37. { include: [ "<bits/types/struct_timespec.h>", private, "<time.h>", public ] },
  38. { include: [ "<bits/types/struct_timeval.h>", private, "<time.h>", public ] },
  39. { include: [ "<bits/types/struct_tm.h>", private, "<time.h>", public ] },
  40. { include: [ "<bits/types/time_t.h>", private, "<time.h>", public ] },
  41. # HACK: check whether this can be removed with next iwyu release.
  42. { symbol: [ "__GLIBC__", private, "<stdlib.h>", public ] },
  43. # HACK: iwyu wrongly thinks that including <iosfwd> is sufficient.
  44. { symbol: [ "std::stringstream", private, "<sstream>", public ] },
  45. { symbol: [ "std::istringstream", private, "<sstream>", public ] },
  46. { symbol: [ "std::ostringstream", private, "<sstream>", public ] },
  47. # HACK: iwyu attributes vector's usage of std::max to its caller.
  48. # https://github.com/include-what-you-use/include-what-you-use/issues/908
  49. { symbol: ["std::max", "private", "<algorithm>", "public" ] },
  50. { symbol: ["std::max", "private", "<vector>", "public" ] },
  51. # Wrappers for 3rd-party libraries
  52. { include: [ "@<.*curl/curlver.h>", private, "<cm3p/curl/curl.h>", public ] },
  53. { include: [ "@<.*curl/system.h>", private, "<cm3p/curl/curl.h>", public ] },
  54. { include: [ "@<.*json/config.h>", private, "<cm3p/json/value.h>", public ] },
  55. { include: [ "@<.*json/forwards.h>", private, "<cm3p/json/value.h>", public ] },
  56. { include: [ "@<.*uv/.+\\.h>", private, "<cm3p/uv.h>", public ] },
  57. { include: [ "@<.*expat_external.h>", private, "<cm3p/expat.h>", public ] },
  58. { include: [ "@<.*zconf.h>", private, "<cm3p/zlib.h>", public ] },
  59. { include: [ "@<.*cm_zlib_mangle.h>", private, "<cm3p/zlib.h>", public ] },
  60. # # System symbols used by libuv
  61. { symbol: [ "ssize_t", private, "<cm3p/uv.h>", public ] },
  62. { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
  63. { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
  64. { symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
  65. { symbol: [ "cmsys::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
  66. { include: [ "<istream>", public, "\"cmsys/FStream.hxx\"", public ] },
  67. { include: [ "<ostream>", public, "\"cmsys/FStream.hxx\"", public ] },
  68. { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] },
  69. { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] },
  70. { symbol: [ "S_IWUSR", private, "\"cm_sys_stat.h\"", public ] },
  71. { symbol: [ "S_IWGRP", private, "\"cm_sys_stat.h\"", public ] },
  72. { include: [ "<filesystem>", public, "<cm/filesystem>", public ] },
  73. { include: [ "<optional>", public, "<cm/optional>", public ] },
  74. { include: [ "<shared_mutex>", public, "<cm/shared_mutex>", public ] },
  75. { include: [ "<string_view>", public, "<cm/string_view>", public ] },
  76. # major and minor are used as macro arguments. Those are false matches.
  77. { symbol: [ "major", private, "\"cmVersion.h\"", public ] },
  78. { symbol: [ "minor", private, "\"cmVersion.h\"", public ] },
  79. { include: [ "<curses.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
  80. { include: [ "\"form.h\"", private, "\"cmCursesStandardIncludes.h\"", public ] },
  81. { include: [ "<form.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
  82. # Help IWYU understand our explicit instantiation for cmStack.
  83. { symbol: [ "cmStack::cmStack<T, Stack, Mutable>", private, "\"cmStack.h\"", public ] },
  84. { symbol: [ "cmStack<cmFindPackageCall, cmFindPackageStack, cmStackType::Mutable>::Empty", private, "\"cmStack.h\"", public ] },
  85. { symbol: [ "cmStack<cmFindPackageCall, cmFindPackageStack, cmStackType::Mutable>::Top", private, "\"cmStack.h\"", public ] },
  86. { symbol: [ "cmStack<cmFindPackageCall, cmFindPackageStack, cmStackType::Mutable>::Pop", private, "\"cmStack.h\"", public ] },
  87. { symbol: [ "cmStack<cmFindPackageCall, cmFindPackageStack, cmStackType::Mutable>::Push", private, "\"cmStack.h\"", public ] },
  88. ]
  89. # vim: set ft=toml: