mapping.imp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [
  2. # C++ alternatives to C standard headers
  3. { include: [ "<assert.h>", public, "<cassert>", public ] },
  4. { include: [ "<complex.h>", public, "<ccomplex>", public ] },
  5. { include: [ "<ctype.h>", public, "<cctype>", public ] },
  6. { include: [ "<errno.h>", public, "<cerrno>", public ] },
  7. { include: [ "<float.h>", public, "<cfloat>", public ] },
  8. { include: [ "<iso646.h>", public, "<ciso646>", public ] },
  9. { include: [ "<limits.h>", public, "<climits>", public ] },
  10. { include: [ "<locale.h>", public, "<clocale>", public ] },
  11. { include: [ "<math.h>", public, "<cmath>", public ] },
  12. { include: [ "<setjmp.h>", public, "<csetjmp>", public ] },
  13. { include: [ "<signal.h>", public, "<csignal>", public ] },
  14. { include: [ "<stdarg.h>", public, "<cstdarg>", public ] },
  15. { include: [ "<stddef.h>", public, "<cstddef>", public ] },
  16. { include: [ "<stdio.h>", public, "<cstdio>", public ] },
  17. { include: [ "<stdlib.h>", public, "<cstdlib>", public ] },
  18. { include: [ "<string.h>", public, "<cstring>", public ] },
  19. { include: [ "<time.h>", public, "<ctime>", public ] },
  20. { include: [ "<wchar.h>", public, "<cwchar>", public ] },
  21. { include: [ "<wctype.h>", public, "<cwctype>", public ] },
  22. # HACK: check whether this can be removed with next iwyu release.
  23. { include: [ "<bits/shared_ptr.h>", private, "<memory>", public ] },
  24. { include: [ "<bits/std_function.h>", private, "<functional>", public ] },
  25. { include: [ "<bits/stdint-intn.h>", private, "<stdint.h>", public ] },
  26. { include: [ "<bits/stdint-uintn.h>", private, "<stdint.h>", public ] },
  27. { include: [ "<bits/time.h>", private, "<time.h>", public ] },
  28. { include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] },
  29. { include: [ "<bits/types/mbstate_t.h>", private, "<wchar.h>", public ] },
  30. { include: [ "<bits/types/struct_timespec.h>", private, "<time.h>", public ] },
  31. { include: [ "<bits/types/struct_timeval.h>", private, "<time.h>", public ] },
  32. { include: [ "<bits/types/struct_tm.h>", private, "<time.h>", public ] },
  33. { include: [ "<bits/types/time_t.h>", private, "<time.h>", public ] },
  34. # HACK: check whether this can be removed with next iwyu release.
  35. { symbol: [ "__GLIBC__", private, "<stdlib.h>", public ] },
  36. { symbol: [ "_Noreturn", private, "<stdlib.h>", public ] },
  37. # HACK: iwyu wrongly thinks that including <iosfwd> is sufficient.
  38. { symbol: [ "std::stringstream", private, "<sstream>", public ] },
  39. { symbol: [ "std::istringstream", private, "<sstream>", public ] },
  40. { symbol: [ "std::ostringstream", private, "<sstream>", public ] },
  41. # HACK: iwyu suggests those two files each time vector[] is used.
  42. # https://github.com/include-what-you-use/include-what-you-use/issues/166
  43. { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] },
  44. { include: [ "<memory>", public, "<vector>", public ] },
  45. # TODO: enable this block and remove some <utility> includes?
  46. #{ symbol: [ "std::pair", private, "<utility>", public ] },
  47. #{ symbol: [ "std::pair", private, "<map>", public ] },
  48. #{ symbol: [ "std::pair", private, "<set>", public ] },
  49. # __decay_and_strip is used internally in the C++11 standard library.
  50. # IWYU does not classify it as internal and suggests to add <type_traits>.
  51. # To ignore it, we simply map it to a file that is included anyway.
  52. # Use '-Xiwyu -v7' to see the fully qualified names that need this.
  53. # TODO: Can this be simplified with an @-expression?
  54. #{ symbol: [ "@std::__decay_and_strip<.*>::__type", private, "\"cmConfigure.h\"", public ] },
  55. { symbol: [ "std::__decay_and_strip<cmCommand *&>::__type", private, "\"cmConfigure.h\"", public ] },
  56. { symbol: [ "std::__decay_and_strip<cmGeneratorTarget *&>::__type", private, "\"cmConfigure.h\"", public ] },
  57. { symbol: [ "std::__decay_and_strip<cmFindCommon::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] },
  58. { symbol: [ "std::__decay_and_strip<cmSearchPath>::__type", private, "\"cmConfigure.h\"", public ] },
  59. { symbol: [ "std::__decay_and_strip<std::basic_string<char> &>::__type", private, "\"cmConfigure.h\"", public ] },
  60. { symbol: [ "std::__decay_and_strip<const std::basic_string<char> &>::__type", private, "\"cmConfigure.h\"", public ] },
  61. { symbol: [ "std::__decay_and_strip<cmFindPackageCommand::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] },
  62. { symbol: [ "std::__decay_and_strip<__gnu_cxx::__normal_iterator<const cmCTestTestHandler::cmCTestTestProperties *, std::vector<cmCTestTestHandler::cmCTestTestProperties, std::allocator<cmCTestTestHandler::cmCTestTestProperties> > > &>::__type", private, "\"cmConfigure.h\"", public ] },
  63. { symbol: [ "std::__success_type<std::chrono::duration<double, std::ratio<1, 1> > >::type", private, "\"cmConfigure.h\"", public ] },
  64. { symbol: [ "std::__success_type<std::chrono::duration<long, std::ratio<1, 1000000000> > >::type", private, "\"cmConfigure.h\"", public ] },
  65. { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<1, 1> > >::type", private, "\"cmConfigure.h\"", public ] },
  66. { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<60, 1> > >::type", private, "\"cmConfigure.h\"", public ] },
  67. { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<1, 1000> > >::type", private, "\"cmConfigure.h\"", public ] },
  68. # KWIML
  69. { include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] },
  70. { include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] },
  71. # Self-sufficient wrapper for <sys/stat.h>
  72. { include: [ "<sys/stat.h>", public, "\"cm_sys_stat.h\"", public ] },
  73. { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] },
  74. # Wrappers for 3rd-party libraries used from the system.
  75. { include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] },
  76. { include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] },
  77. { include: [ "@<curl/.+\\.h>", private, "\"cm_curl.h\"", public ] },
  78. { include: [ "<expat.h>", private, "\"cm_expat.h\"", public ] },
  79. { include: [ "<expat_external.h>", private, "\"cm_expat.h\"", public ] },
  80. { include: [ "<json/reader.h>", private, "\"cm_jsoncpp_reader.h\"", public ] },
  81. { include: [ "<json/value.h>", private, "\"cm_jsoncpp_value.h\"", public ] },
  82. { include: [ "<json/writer.h>", private, "\"cm_jsoncpp_writer.h\"", public ] },
  83. { include: [ "<rhash.h>", private, "\"cm_rhash.h\"", public ] },
  84. { include: [ "<uv.h>", private, "\"cm_uv.h\"", public ] },
  85. { include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] },
  86. { include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] },
  87. { include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] },
  88. { include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] },
  89. { include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] },
  90. { include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] },
  91. { include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] },
  92. { include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] },
  93. # Wrappers for bundled 3rd-party libraries.
  94. { include: [ "\"cmlibarchive/libarchive/archive.h\"", private, "\"cm_libarchive.h\"", public ] },
  95. { include: [ "\"cmlibarchive/libarchive/archive_entry.h\"", private, "\"cm_libarchive.h\"", public ] },
  96. { include: [ "@\"cmcurl/include/curl/.+\\.h\"", private, "\"cm_curl.h\"", public ] },
  97. { include: [ "\"cmexpat/lib/expat.h\"", private, "\"cm_expat.h\"", public ] },
  98. { include: [ "\"cmexpat/lib/expat_external.h\"", private, "\"cm_expat.h\"", public ] },
  99. { include: [ "\"cmjsoncpp/include/json/reader.h\"", private, "\"cm_jsoncpp_reader.h\"", public ] },
  100. { include: [ "\"cmjsoncpp/include/json/value.h\"", private, "\"cm_jsoncpp_value.h\"", public ] },
  101. { include: [ "\"cmjsoncpp/include/json/writer.h\"", private, "\"cm_jsoncpp_writer.h\"", public ] },
  102. { include: [ "\"cmlibrhash/librhash/rhash.h\"", private, "\"cm_rhash.h\"", public ] },
  103. { include: [ "\"cmlibuv/include/uv.h\"", private, "\"cm_uv.h\"", public ] },
  104. { include: [ "@\"cmlibuv/include/uv-.+\\.h\"", private, "\"cm_uv.h\"", public ] },
  105. { include: [ "\"KWIML/include/kwiml/abi.h\"", private, "\"cm_kwiml.h\"", public ] },
  106. { include: [ "\"KWIML/include/kwiml/int.h\"", private, "\"cm_kwiml.h\"", public ] },
  107. { include: [ "\"cmzlib/cm_zlib_mangle.h\"", private, "\"cm_zlib.h\"", public ] },
  108. { include: [ "\"cmzlib/zconf.h\"", private, "\"cm_zlib.h\"", public ] },
  109. { include: [ "\"cmzlib/zlib.h\"", private, "\"cm_zlib.h\"", public ] },
  110. # System symbols used by libuv
  111. { symbol: [ "SIGHUP", private, "\"cm_uv.h\"", public ] },
  112. { symbol: [ "SIGINT", private, "\"cm_uv.h\"", public ] },
  113. { symbol: [ "ssize_t", private, "\"cm_uv.h\"", public ] },
  114. { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
  115. { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
  116. { symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
  117. { symbol: [ "cmsys::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
  118. { include: [ "<istream>", public, "\"cmsys/FStream.hxx\"", public ] },
  119. { include: [ "<ostream>", public, "\"cmsys/FStream.hxx\"", public ] },
  120. { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] },
  121. # major and minor are used as macro arguments. Those are false matches.
  122. { symbol: [ "major", private, "\"cm_kwiml.h\"", public ] },
  123. { symbol: [ "minor", private, "\"cm_kwiml.h\"", public ] },
  124. { symbol: [ "major", private, "\"cmVersion.h\"", public ] },
  125. { symbol: [ "minor", private, "\"cmVersion.h\"", public ] },
  126. { include: [ "<curses.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
  127. { include: [ "\"form.h\"", private, "\"cmCursesStandardIncludes.h\"", public ] },
  128. { include: [ "<form.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
  129. ]
  130. # vim: set ft=toml: