From bcd08aa383e92b3fe53faa23cb7509796b9dd8db Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 17 Feb 2017 23:27:34 +0100 Subject: cmCTest: Move macros to bottom of file Since the class name is used in the macros, the iwyu tool gets confused wheter it needs a forward declaration or not. --- Source/cmCTest.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index ebdc8b0..be736da 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -20,22 +20,6 @@ class cmGeneratedFileStream; class cmMakefile; class cmXMLWriter; -#define cmCTestLog(ctSelf, logType, msg) \ - do { \ - std::ostringstream cmCTestLog_msg; \ - cmCTestLog_msg << msg; \ - (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \ - cmCTestLog_msg.str().c_str()); \ - } while (false) - -#define cmCTestOptionalLog(ctSelf, logType, msg, suppress) \ - do { \ - std::ostringstream cmCTestLog_msg; \ - cmCTestLog_msg << msg; \ - (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \ - cmCTestLog_msg.str().c_str(), suppress); \ - } while (false) - /** \class cmCTest * \brief Represents a ctest invocation. * @@ -647,4 +631,20 @@ inline std::ostream& operator<<(std::ostream& os, const cmCTestLogWrite& c) return os; } +#define cmCTestLog(ctSelf, logType, msg) \ + do { \ + std::ostringstream cmCTestLog_msg; \ + cmCTestLog_msg << msg; \ + (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \ + cmCTestLog_msg.str().c_str()); \ + } while (false) + +#define cmCTestOptionalLog(ctSelf, logType, msg, suppress) \ + do { \ + std::ostringstream cmCTestLog_msg; \ + cmCTestLog_msg << msg; \ + (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \ + cmCTestLog_msg.str().c_str(), suppress); \ + } while (false) + #endif -- cgit v0.12 From 2a827b8244d451071c02e3a3c8398bcb8b0e01fd Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 17 Feb 2017 23:28:58 +0100 Subject: cmCPackGenerator: Move macros to bottom of file Since the class name is used in the macros, the iwyu tool gets confused wheter it needs a forward declaration or not. --- Source/CPack/cmCPackGenerator.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 57b8fff..39fd2cc 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -17,20 +17,6 @@ class cmCPackLog; class cmInstalledFile; class cmMakefile; -#define cmCPackTypeMacro(klass, superclass) \ - typedef superclass Superclass; \ - const char* GetNameOfClass() CM_OVERRIDE { return #klass; } \ - static cmCPackGenerator* CreateGenerator() { return new klass; } \ - class cmCPackTypeMacro_UseTrailingSemicolon - -#define cmCPackLogger(logType, msg) \ - do { \ - std::ostringstream cmCPackLog_msg; \ - cmCPackLog_msg << msg; \ - this->Logger->Log(logType, __FILE__, __LINE__, \ - cmCPackLog_msg.str().c_str()); \ - } while (false) - /** \class cmCPackGenerator * \brief A superclass of all CPack Generators * @@ -311,4 +297,18 @@ private: cmMakefile* MakefileMap; }; +#define cmCPackTypeMacro(klass, superclass) \ + typedef superclass Superclass; \ + const char* GetNameOfClass() CM_OVERRIDE { return #klass; } \ + static cmCPackGenerator* CreateGenerator() { return new klass; } \ + class cmCPackTypeMacro_UseTrailingSemicolon + +#define cmCPackLogger(logType, msg) \ + do { \ + std::ostringstream cmCPackLog_msg; \ + cmCPackLog_msg << msg; \ + this->Logger->Log(logType, __FILE__, __LINE__, \ + cmCPackLog_msg.str().c_str()); \ + } while (false) + #endif -- cgit v0.12 From 72ea66b1cf28bba68f2b81637864a330e3ae715f Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 23 Mar 2017 23:19:45 +0100 Subject: Autogen: include what you use --- Source/cmQtAutoGeneratorCommon.cxx | 1 + Source/cmQtAutoGeneratorCommon.h | 5 +---- Source/cmQtAutoGeneratorInitializer.cxx | 6 +----- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/cmQtAutoGeneratorCommon.cxx b/Source/cmQtAutoGeneratorCommon.cxx index dcd61a3..2498fe8 100644 --- a/Source/cmQtAutoGeneratorCommon.cxx +++ b/Source/cmQtAutoGeneratorCommon.cxx @@ -8,6 +8,7 @@ #include #include +#include // - Static functions diff --git a/Source/cmQtAutoGeneratorCommon.h b/Source/cmQtAutoGeneratorCommon.h index b54b6fa..b004005 100644 --- a/Source/cmQtAutoGeneratorCommon.h +++ b/Source/cmQtAutoGeneratorCommon.h @@ -3,13 +3,10 @@ #ifndef cmQtAutoGeneratorCommon_h #define cmQtAutoGeneratorCommon_h -#include // IWYU pragma: keep +#include #include #include -class cmGeneratorTarget; -class cmLocalGenerator; - class cmQtAutoGeneratorCommon { // - Types and statics diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 6ebc234..ead3dfc 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -7,12 +7,11 @@ #include "cmCustomCommandLines.h" #include "cmFilePathChecksum.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" #include "cmSourceFile.h" -#include "cmSourceFileLocation.h" +#include "cmSourceGroup.h" #include "cmState.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -25,11 +24,8 @@ #include #include #include -#include #include #include -#include -#include #include #include #include -- cgit v0.12 From 41ec352832037d316c34b3eba336eeb7f4163d86 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 23 Mar 2017 23:27:08 +0100 Subject: IWYU: use pragma export --- Source/cmConfigure.cmake.h.in | 2 +- Source/cmDynamicLoader.cxx | 1 - Source/cmDynamicLoader.h | 2 +- Source/cmSystemTools.cxx | 1 - Source/cmSystemTools.h | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 26f1df2..5f89ba1 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -3,7 +3,7 @@ #ifndef cmConfigure_h #define cmConfigure_h -#include // IWYU pragma: keep +#include // IWYU pragma: export #ifdef _MSC_VER #pragma warning(disable : 4786) diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index a30b642..39a59fc 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -4,7 +4,6 @@ #include -#include #include #include #include diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index d14f81e..5d69400 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -10,7 +10,7 @@ #include // IWYU pragma: keep -#include +#include "cmsys/DynamicLoader.hxx" // IWYU pragma: export class cmDynamicLoader { diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index b7afa10..b2e3c6a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 10e8280..070f81f 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -5,9 +5,9 @@ #include // IWYU pragma: keep +#include "cmsys/SystemTools.hxx" // IWYU pragma: export #include #include -#include #include #include #include -- cgit v0.12