From cd0881be61149346649f3aef9b69d58bd7a2549a Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 15 Jan 2019 09:59:46 -0500 Subject: IWYU: Update CMake code for IWYU built with Clang 6 IWYU now correctly requires `` for `std::move`. It also requires a container header when used via a range-based for loop. --- Source/CPack/cmCPackArchiveGenerator.cxx | 1 + Source/CPack/cmCPackExternalGenerator.cxx | 1 + Source/CPack/cmCPackSTGZGenerator.cxx | 1 + Source/CTest/cmParseMumpsCoverage.cxx | 1 + Source/CTest/cmProcess.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 1 + Source/cmExportInstallFileGenerator.cxx | 3 +-- Source/cmExtraEclipseCDT4Generator.cxx | 1 + Source/cmFileAPICMakeFiles.cxx | 1 + Source/cmFileAPICache.cxx | 1 + Source/cmFileCommand.cxx | 1 + Source/cmFindLibraryCommand.cxx | 1 + Source/cmIncludeDirectoryCommand.cxx | 1 + Source/cmInstallExportGenerator.cxx | 1 + Source/cmJsonObjects.cxx | 1 + Source/cmListCommand.cxx | 1 + Source/cmMakefileExecutableTargetGenerator.cxx | 1 + Source/cmMakefileLibraryTargetGenerator.cxx | 1 + Source/cmNinjaNormalTargetGenerator.cxx | 1 + Source/cmNinjaTargetGenerator.cxx | 1 + Source/cmPipeConnection.cxx | 2 +- Source/cmQtAutoGen.cxx | 1 + Source/cmQtAutoGenerator.cxx | 1 + Source/cmQtAutoGeneratorMocUic.cxx | 4 +++- Source/cmQtAutoGeneratorMocUic.h | 2 +- Source/cmServerConnection.cxx | 2 +- Source/cmString.hxx | 1 + Source/cmTestGenerator.cxx | 3 +-- Source/cmcmd.cxx | 1 + Tests/CMakeLib/testUVRAII.cxx | 2 +- Utilities/IWYU/mapping.imp | 3 +++ 31 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index ee1070f..b43f1c9 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -10,6 +10,7 @@ #include "cmWorkingDirectory.h" #include +#include #include #include #include diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 9f7b236..ff69418 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -13,6 +13,7 @@ #include "cmsys/FStream.hxx" +#include #include #include diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index ef0d118..e55ea87 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -6,6 +6,7 @@ #include #include #include +#include #include "cmCPackGenerator.h" #include "cmCPackLog.h" diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index 18412ba..488d237 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -9,6 +9,7 @@ #include #include #include +#include cmParseMumpsCoverage::cmParseMumpsCoverage( cmCTestCoverageHandlerContainer& cont, cmCTest* ctest) diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index c4cf046..7737f65 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -7,7 +7,6 @@ #include "cmCTestTestHandler.h" #include "cmsys/Process.h" -#include #include #include #include @@ -15,6 +14,7 @@ #if !defined(_WIN32) # include #endif +#include #define CM_PROCESS_BUF_SIZE 65536 diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 1f9f580..106e7a7 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -5,6 +5,7 @@ #include "cmsys/Directory.hxx" #include #include +#include #include "cmAlgorithms.h" #include "cmMakefile.h" diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 93115b6..3821144 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -4,6 +4,7 @@ #include "cmAlgorithms.h" #include "cmExportSet.h" +#include "cmExportSetMap.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -21,8 +22,6 @@ #include #include -class cmExportSetMap; - cmExportInstallFileGenerator::cmExportInstallFileGenerator( cmInstallExportGenerator* iegen) : IEGen(iegen) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index e7f3ada..84fcb95 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -5,6 +5,7 @@ #include "cmsys/RegularExpression.hxx" #include #include +#include #include #include #include diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx index 799a047..5590bc2 100644 --- a/Source/cmFileAPICMakeFiles.cxx +++ b/Source/cmFileAPICMakeFiles.cxx @@ -12,6 +12,7 @@ #include "cm_jsoncpp_value.h" #include +#include namespace { diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx index 074994a..f96bc90 100644 --- a/Source/cmFileAPICache.cxx +++ b/Source/cmFileAPICache.cxx @@ -10,6 +10,7 @@ #include #include +#include #include namespace { diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index fc9c1d2..475eee4 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "cmAlgorithms.h" diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 5a5d036..bcf876d 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -7,6 +7,7 @@ #include #include #include +#include #include "cmGlobalGenerator.h" #include "cmMakefile.h" diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index caec67d..549a263 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -4,6 +4,7 @@ #include #include +#include #include "cmGeneratorExpression.h" #include "cmMakefile.h" diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index d441e41..4cc081c 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -3,6 +3,7 @@ #include "cmInstallExportGenerator.h" #include +#include #include #include diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 0da6f4f..bb56714 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -14,6 +14,7 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmProperty.h" +#include "cmPropertyMap.h" #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 9b63d24..3644da1 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -12,6 +12,7 @@ #include #include #include // required for atoi +#include #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 846b12c..92eeb2e 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -6,6 +6,7 @@ #include // IWYU pragma: keep #include #include +#include #include #include "cmGeneratedFileStream.h" diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 2d2915c..0c2d7b3 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -6,6 +6,7 @@ #include // IWYU pragma: keep #include #include +#include #include #include "cmGeneratedFileStream.h" diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 324afbf..b62da66 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -9,6 +9,7 @@ #include // IWYU pragma: keep #include #include +#include #include "cmAlgorithms.h" #include "cmCustomCommandGenerator.h" diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 228c9fb..1ef12d0 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -10,6 +10,7 @@ #include #include // IWYU pragma: keep #include +#include #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx index 3dab2f0..999d6f3 100644 --- a/Source/cmPipeConnection.cxx +++ b/Source/cmPipeConnection.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPipeConnection.h" -#include +#include #include "cmServer.h" diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx index 000529d..2786646 100644 --- a/Source/cmQtAutoGen.cxx +++ b/Source/cmQtAutoGen.cxx @@ -9,6 +9,7 @@ #include #include #include +#include // - Static variables diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 734b2d7..f2f4cad 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -14,6 +14,7 @@ #include "cmake.h" #include +#include // -- Class methods diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index e6ee85b..9658e97 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1,19 +1,21 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGeneratorMocUic.h" -#include "cmQtAutoGen.h" #include #include +#include #include #include #include +#include #include #include #include "cmAlgorithms.h" #include "cmCryptoHash.h" #include "cmMakefile.h" +#include "cmQtAutoGen.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h index edf597c..9ec1def 100644 --- a/Source/cmQtAutoGeneratorMocUic.h +++ b/Source/cmQtAutoGeneratorMocUic.h @@ -11,7 +11,6 @@ #include "cm_uv.h" #include "cmsys/RegularExpression.hxx" -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include class cmMakefile; diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index 1fc8cf8..5caa019 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -7,13 +7,13 @@ #include "cmServerDictionary.h" #include "cm_uv.h" -#include #ifdef _WIN32 # include "io.h" #else # include #endif #include +#include cmStdIoConnection::cmStdIoConnection( cmConnectionBufferStrategy* bufferStrategy) diff --git a/Source/cmString.hxx b/Source/cmString.hxx index e5ece52..49bad78 100644 --- a/Source/cmString.hxx +++ b/Source/cmString.hxx @@ -15,6 +15,7 @@ #include #include #include +#include namespace cm { diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index e4ced6e..1e2ddc7 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -11,12 +11,11 @@ #include "cmLocalGenerator.h" #include "cmOutputConverter.h" #include "cmProperty.h" +#include "cmPropertyMap.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTest.h" -class cmPropertyMap; - cmTestGenerator::cmTestGenerator( cmTest* test, std::vector const& configurations) : cmScriptGenerator("CTEST_CONFIGURATION_TYPE", configurations) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 7287594..24e3dc8 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -44,6 +44,7 @@ #include #include #include +#include class cmConnection; diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx index e165ff7..1c1da76 100644 --- a/Tests/CMakeLib/testUVRAII.cxx +++ b/Tests/CMakeLib/testUVRAII.cxx @@ -1,9 +1,9 @@ #include "cmUVHandlePtr.h" -#include #include #include #include +#include #include "cm_uv.h" diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index c5231bb..aee8a69 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -55,6 +55,9 @@ # HACK: iwyu wrongly thinks that is needed for std::hash { symbol: [ "std::hash", private, "", public ] }, + # HACK: iwyu thinks we use a libstdc++ private type + { symbol: [ "__gnu_cxx::size_t", private, "", public ] }, + # __decay_and_strip is used internally in the C++11 standard library. # IWYU does not classify it as internal and suggests to add . # To ignore it, we simply map it to a file that is included anyway. -- cgit v0.12