diff options
author | Brad King <brad.king@kitware.com> | 2019-07-10 11:38:48 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-10 11:48:56 -0400 |
commit | 71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 (patch) | |
tree | dc884b3c88488e3aecf3c1676ad404bbc6756587 | |
parent | 4fc10431f06a07cd7ac1fafa7f3a8e633bea204c (diff) | |
download | cmake-71fbebd1dc3a24e2478bb5704d9ac20f36cbf704.tar.gz |
IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints. Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
88 files changed, 104 insertions, 69 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7e07ff4888..4a91698697 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -7,7 +7,7 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> #include <cstring> -#include <memory> // IWYU pragma: keep +#include <memory> #include <utility> #include "cmCPackComponentGroup.h" diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 58b9e70fa1..67b7ea60f0 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -5,7 +5,6 @@ #include "cmsys/Encoding.hxx" #include <iostream> #include <map> -#include <memory> // IWYU pragma: keep #include <sstream> #include <stddef.h> #include <string> diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index a96513e8c8..237ca82daa 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -6,7 +6,6 @@ #include "cmsys/Process.h" #include "cmsys/RegularExpression.hxx" #include <iostream> -#include <memory> // IWYU pragma: keep #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index ef63073b1a..37a8abf658 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -29,11 +29,13 @@ #include <iostream> #include <list> #include <math.h> +#include <memory> #include <sstream> #include <stack> #include <stdlib.h> #include <unordered_map> #include <utility> +#include <vector> namespace cmsys { class RegularExpression; diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 38cc417e5a..43dfe8eaba 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <memory> #include <set> #include <stddef.h> #include <string> @@ -12,7 +13,7 @@ #include "cmCTestTestHandler.h" #include "cmDuration.h" -#include "cmProcess.h" // IWYU pragma: keep (for unique_ptr) +#include "cmProcess.h" class cmCTest; class cmCTestMultiProcessHandler; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 0ed56c850c..46ef809bee 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -11,7 +11,7 @@ #include <functional> #include <iomanip> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <stdio.h> diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 5cfc4a7cdf..fb97e9b3f4 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -18,7 +18,7 @@ #include "cmXMLWriter.h" #include <chrono> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> static const char* cmCTestUpdateHandlerUpdateStrings[] = { diff --git a/Source/cmBinUtilsLinuxELFLinker.h b/Source/cmBinUtilsLinuxELFLinker.h index 348edc44de..e20963784a 100644 --- a/Source/cmBinUtilsLinuxELFLinker.h +++ b/Source/cmBinUtilsLinuxELFLinker.h @@ -9,7 +9,7 @@ #include "cmLDConfigTool.h" #include "cmStateTypes.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmBinUtilsMacOSMachOLinker.h b/Source/cmBinUtilsMacOSMachOLinker.h index 0350d1e7c9..f4f309d0ae 100644 --- a/Source/cmBinUtilsMacOSMachOLinker.h +++ b/Source/cmBinUtilsMacOSMachOLinker.h @@ -8,7 +8,7 @@ #include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h" #include "cmStateTypes.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmBinUtilsWindowsPELinker.h b/Source/cmBinUtilsWindowsPELinker.h index d7421952b9..8d2bf4b73f 100644 --- a/Source/cmBinUtilsWindowsPELinker.h +++ b/Source/cmBinUtilsWindowsPELinker.h @@ -8,7 +8,7 @@ #include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" #include "cmStateTypes.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> class cmRuntimeDependencyArchive; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d1226c3c89..536ca359d0 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -15,7 +15,7 @@ #include <ctype.h> #include <iostream> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmCTest.h b/Source/cmCTest.h index d300c33fac..7f6637863c 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -10,7 +10,7 @@ #include <chrono> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <string> #include <time.h> diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 0b1f00cfc1..839c27a849 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -10,6 +10,7 @@ #include "cmTargetLinkLibraryType.h" #include <map> +#include <memory> #include <queue> #include <set> #include <string> diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index d914eb1421..4310eed340 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -8,7 +8,7 @@ #include "cmsys/FStream.hxx" #include <string.h> -#include <memory> // IWYU pragma: keep +#include <memory> static unsigned int const cmCryptoHashAlgoToId[] = { /* clang-format needs this comment to break after the opening brace */ diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index b712f09da3..c7d3377e4b 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <memory> // IWYU pragma: keep +#include <memory> #include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 89aaad0dce..5e8731a7b2 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -12,7 +12,7 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <stddef.h> #include <utility> diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 2226463654..51eb814a13 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -6,7 +6,7 @@ #include "cm_kwiml.h" #include "cmsys/FStream.hxx" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stddef.h> #include <utility> diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 494afbb559..121f33f782 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -4,10 +4,13 @@ #include "cm_static_string_view.hxx" #include "cmsys/Process.h" + #include <algorithm> #include <ctype.h> /* isspace */ #include <iostream> +#include <memory> #include <stdio.h> +#include <vector> #include "cmAlgorithms.h" #include "cmArgumentParser.h" diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index ced27c91ca..e693155d6a 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -3,7 +3,6 @@ #include "cmExportBuildAndroidMKGenerator.h" #include <algorithm> -#include <memory> // IWYU pragma: keep #include <sstream> #include <utility> diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index c366183af0..e1c098d76b 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -20,7 +20,7 @@ #include "cmsys/FStream.hxx" #include <assert.h> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <string.h> #include <utility> diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index b60a0533c3..2e86533541 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -4,7 +4,7 @@ #include "cmsys/FStream.hxx" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index c169032dd2..a3c9802d7f 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -13,7 +13,7 @@ #include "cmTarget.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <utility> cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator( diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 602efa8ed5..aa5a42fa85 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h @@ -10,7 +10,7 @@ #include "cm_jsoncpp_writer.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <unordered_set> #include <vector> diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 0fb166af56..73b4123b19 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -31,6 +31,7 @@ #include <algorithm> #include <cassert> #include <map> +#include <memory> #include <set> #include <string> #include <unordered_map> diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 980ad21333..dfba910ee3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -13,7 +13,7 @@ #include <cmath> #include <ctype.h> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <stdio.h> diff --git a/Source/cmFileTimes.h b/Source/cmFileTimes.h index cbf0fe20a9..191d89e94c 100644 --- a/Source/cmFileTimes.h +++ b/Source/cmFileTimes.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> /** \class cmFileTimes diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 50ae6a93f7..783b5f64d5 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -13,7 +13,7 @@ #include <deque> #include <functional> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <string.h> diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 08003eb71d..7f189d69f5 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 175a26d2e8..4d3a005caf 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -3,7 +3,7 @@ #include "cmGeneratorExpression.h" #include "cmsys/RegularExpression.hxx" -#include <memory> // IWYU pragma: keep +#include <memory> #include <utility> #include "assert.h" diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index fd36c4bcb0..ef76651945 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -8,7 +8,7 @@ #include "cmListFileCache.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <utility> diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 326cb0e555..11c2dccf13 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -3,7 +3,7 @@ #include "cmGeneratorExpressionEvaluationFile.h" #include "cmsys/FStream.hxx" -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <utility> diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index 89a2390571..06ebeac8ed 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index a60c75cd96..d828dacd96 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -33,7 +33,7 @@ #include <errno.h> #include <iterator> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <stdlib.h> diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 85a8dbb298..845937a0e7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -7,7 +7,7 @@ #include <assert.h> #include <errno.h> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <queue> #include <sstream> #include <stdio.h> diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index b80da7231f..997595ba8f 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -22,9 +22,11 @@ #include "cmTarget.h" #include <algorithm> +#include <memory> #include <ostream> #include <set> #include <utility> +#include <vector> cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target) : GeneratorTarget(target) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7fd54331ef..e36825cce3 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -7,6 +7,7 @@ #include <iosfwd> #include <map> +#include <memory> #include <set> #include <string> #include <unordered_map> diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2d52356bc0..98e8339186 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -9,7 +9,7 @@ #include <algorithm> #include <ctype.h> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 15dd4044e3..99afc1df10 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -7,7 +7,7 @@ #include <iosfwd> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <unordered_map> diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index aa584add7e..93f54821f6 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -4,6 +4,7 @@ #include <algorithm> #include <functional> +#include <memory> #include <sstream> #include <utility> diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7c2bcd3865..78e8f3067d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -5,7 +5,7 @@ #include "cmsys/RegularExpression.hxx" #include <assert.h> #include <iomanip> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <string.h> diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index a75d8a97a0..9befb78c3f 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -4,7 +4,7 @@ #include <cstddef> #include <iostream> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <utility> diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index d1f8f58e22..6f328616ab 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -11,7 +11,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <memory> // IWYU pragma: keep +#include <memory> static std::string cmIfCommandError( std::vector<cmExpandedCommandArgument> const& args) diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 14288f6d23..c8ebc8c49d 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -8,7 +8,7 @@ #include "cmMakefile.h" #include "cmSystemTools.h" -#include <memory> // IWYU pragma: keep +#include <memory> cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector<std::string> const& dirs, const char* dest, diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 2ed9f734d6..e8e82cc354 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -6,7 +6,7 @@ #include "cmInstallType.h" #include "cmSystemTools.h" -#include <memory> // IWYU pragma: keep +#include <memory> class cmLocalGenerator; diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 5832d27e60..b7b7817c6e 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallScriptGenerator.h" +#include <memory> #include <ostream> #include <vector> diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 07744369fd..d891ad8f12 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -4,6 +4,7 @@ #include <assert.h> #include <map> +#include <memory> #include <set> #include <sstream> #include <utility> diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index b7d602ef42..eb827be573 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -8,7 +8,7 @@ #include "cmGeneratorExpression.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 8d065e1ad7..505188f020 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -31,6 +31,7 @@ #include <functional> #include <limits> #include <map> +#include <memory> #include <set> #include <string> #include <unordered_map> diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 1b01ea2022..e9a4a6f517 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -7,12 +7,14 @@ #include <assert.h> #include <functional> #include <iterator> +#include <memory> #include <set> #include <sstream> #include <stdexcept> #include <stdio.h> #include <stdlib.h> // required for atoi #include <utility> +#include <vector> #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 945741540b..5de1a74506 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> -#include <memory> // IWYU pragma: keep +#include <memory> #include <stddef.h> #include <string> #include <utility> diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 801f0e87d8..0f730c9ea0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -26,22 +26,24 @@ #include "cmTestGenerator.h" #include "cmVersion.h" #include "cmake.h" +#include "cmsys/RegularExpression.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) # define CM_LG_ENCODE_OBJECT_NAMES # include "cmCryptoHash.h" #endif -#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> #include <initializer_list> #include <iterator> +#include <memory> #include <sstream> #include <stdio.h> #include <string.h> #include <unordered_set> #include <utility> +#include <vector> #if defined(__HAIKU__) # include <FindDirectory.h> diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 81cafa3218..248f4a685a 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -5,7 +5,7 @@ #include <algorithm> #include <assert.h> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <utility> diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index c392e97879..1b4f428189 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -5,7 +5,7 @@ #include "cmsys/FStream.hxx" #include "cmsys/Terminal.h" #include <algorithm> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <utility> diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 3fdafd2b2d..585eb3c335 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include "cmGlobalVisualStudioGenerator.h" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bd98f08155..5f22a07c82 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -9,7 +9,7 @@ #include <cstring> #include <ctype.h> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d223347519..d0b70d9864 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -8,7 +8,7 @@ #include "cmsys/RegularExpression.hxx" #include <deque> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <stack> #include <stddef.h> diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 6b9b9c7f1c..2001c1f29b 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <string> diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b9f7c6d137..e5aed01368 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <stddef.h> diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b3bab4b08a..b5a6246a7e 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <utility> diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index c570a7ccf9..9eeeed07ac 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -7,6 +7,7 @@ #include <iosfwd> #include <map> +#include <memory> #include <set> #include <string> #include <vector> diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 42369954cc..70d9fca529 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" +#include <memory> #include <ostream> #include <string> #include <utility> diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index f65abc8391..d1af9e6716 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -6,7 +6,7 @@ #include <assert.h> #include <iterator> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <sstream> #include <utility> diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2139a452d7..57e500ea5f 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -8,7 +8,7 @@ #include <assert.h> #include <iterator> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <ostream> #include <utility> diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 3055e18c34..a99d8e7e42 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -13,7 +13,7 @@ #include "cmOSXBundleGenerator.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <vector> diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 585db423ec..2d055ff17d 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -13,6 +13,7 @@ #include <assert.h> #include <functional> #include <sstream> +#include <vector> /* Directory ordering computation. diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h index 9c52129527..619fff14f0 100644 --- a/Source/cmQtAutoGen.h +++ b/Source/cmQtAutoGen.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h index d56153ab7a..d7f4cc6e10 100644 --- a/Source/cmQtAutoGenGlobalInitializer.h +++ b/Source/cmQtAutoGenGlobalInitializer.h @@ -8,7 +8,7 @@ #include "cmQtAutoGen.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <unordered_map> #include <vector> diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index aa073d1fdd..eb0d35e0c0 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -8,7 +8,7 @@ #include "cmQtAutoGen.h" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <ostream> #include <set> #include <string> diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index e1c435be07..3a3162daf0 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -14,6 +14,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <memory> + cmQtAutoGenerator::Logger::Logger() { // Initialize logger diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h index 8061c13e6b..dc18328845 100644 --- a/Source/cmQtAutoMocUic.h +++ b/Source/cmQtAutoMocUic.h @@ -14,7 +14,7 @@ #include <atomic> #include <cstddef> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <unordered_map> diff --git a/Source/cmRuntimeDependencyArchive.h b/Source/cmRuntimeDependencyArchive.h index ec3ecd4603..67efec7df3 100644 --- a/Source/cmRuntimeDependencyArchive.h +++ b/Source/cmRuntimeDependencyArchive.h @@ -9,7 +9,7 @@ #include "cmsys/RegularExpression.hxx" #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <vector> diff --git a/Source/cmServer.h b/Source/cmServer.h index aba4924c90..ab2ad239fd 100644 --- a/Source/cmServer.h +++ b/Source/cmServer.h @@ -10,7 +10,7 @@ #include "cmUVHandlePtr.h" -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmState.h b/Source/cmState.h index accd8381e0..0649acea7b 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <map> +#include <memory> #include <set> #include <string> #include <vector> diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 6ca1c9f555..3f70ed329d 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -6,6 +6,7 @@ #include <algorithm> #include <assert.h> #include <iterator> +#include <vector> #include "cmAlgorithms.h" #include "cmProperty.h" diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 998f90415b..10ccac02e3 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -8,7 +8,7 @@ #include <algorithm> #include <ctype.h> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmTarget.h b/Source/cmTarget.h index fdcca47b8d..f47cc14c2b 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <utility> diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 498953e452..916784c3ad 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -2,8 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTestGenerator.h" +#include <memory> #include <ostream> #include <utility> +#include <vector> #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h index 2b3352070b..75f8f6623c 100644 --- a/Source/cmUVProcessChain.h +++ b/Source/cmUVProcessChain.h @@ -7,7 +7,7 @@ #include <array> #include <iosfwd> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 1230101797..acac2c1a58 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <string> #include <vector> diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 04208818a5..d17a6d8ccd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -19,7 +19,7 @@ #include "windows.h" #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> static void ConvertToWindowsSlash(std::string& s); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index a01fa6f1c8..0d3bdf8e51 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -9,7 +9,7 @@ #include "cmMessageType.h" #include "cmSystemTools.h" -#include <memory> // IWYU pragma: keep +#include <memory> cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index f08bb4f8d0..5cc308bca8 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -7,7 +7,7 @@ #include "cmAlgorithms.h" // IWYU pragma: keep -#include <memory> // IWYU pragma: keep +#include <memory> #include <stdint.h> #include <string> #include <utility> diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ca3b405ea4..b8238a2e8c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -104,7 +104,7 @@ #include <cstring> #include <initializer_list> #include <iostream> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmake.h b/Source/cmake.h index c03872b7c5..6aa00e147f 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -7,7 +7,7 @@ #include <functional> #include <map> -#include <memory> // IWYU pragma: keep +#include <memory> #include <set> #include <string> #include <unordered_set> diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 86082e5174..effc0943c2 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -41,7 +41,7 @@ #include <array> #include <iostream> #include <iterator> -#include <memory> // IWYU pragma: keep +#include <memory> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index 72ae60203a..e926350495 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -10,6 +10,7 @@ #include <algorithm> #include <functional> #include <iostream> +#include <memory> #include <sstream> #include <string> #include <vector> diff --git a/Tests/CMakeServerLib/testServerBuffering.cpp b/Tests/CMakeServerLib/testServerBuffering.cpp index 7330eadf75..8b0b89b7fb 100644 --- a/Tests/CMakeServerLib/testServerBuffering.cpp +++ b/Tests/CMakeServerLib/testServerBuffering.cpp @@ -1,6 +1,8 @@ #include "cmConnection.h" #include "cmServerConnection.h" + #include <iostream> +#include <memory> #include <string> #include <vector> diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 0393ff199e..4e00214f91 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -42,10 +42,17 @@ { symbol: [ "std::istringstream", private, "<sstream>", public ] }, { symbol: [ "std::ostringstream", private, "<sstream>", public ] }, - # HACK: iwyu suggests those two files each time vector[] is used. + # HACK: iwyu suggests <ext/alloc_traits.h> and <memory> each time vector[] is used. # https://github.com/include-what-you-use/include-what-you-use/issues/166 { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] }, - { include: [ "<memory>", public, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmComputeComponentGraph::TarjanEntry> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmFortranFile> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmGraphEdgeList> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmOrderDirectories::ConflictList> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmStateSnapshot> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char> > >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > > >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<uv_stdio_container_s> >::value_type", private, "<vector>", public ] }, # TODO: enable this block and remove some <utility> includes? #{ symbol: [ "std::pair", private, "<utility>", public ] }, |