Skip to content

Commit

Permalink
cleaned up includes based on include-what-you-use
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Apr 11, 2024
1 parent d0de1fe commit 6d3d868
Show file tree
Hide file tree
Showing 35 changed files with 76 additions and 83 deletions.
104 changes: 52 additions & 52 deletions Makefile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <sstream>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions cli/signalhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//#include <features.h> // __USE_DYNAMIC_STACK_SIZE
#include <map>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "cppcheck.h"
#include "common.h"
#include "mainwindow.h"
#include "erroritem.h"
#include "erroritem.h" // IWYU pragma: keep
#include "translationhandler.h"

#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion gui/test/projectfile/testprojectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

#include "testprojectfile.h"

#include "addoninfo.h"
#include "importproject.h"
#include "platform.h"
#include "projectfile.h"
#include "settings.h"
#include "suppressions.h"

#include <string>

Expand Down
1 change: 1 addition & 0 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "symboldatabase.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "platform.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
Expand Down
1 change: 0 additions & 1 deletion lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <set>
#include <sstream>
#include <utility>
#include <numeric>

//---------------------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class TokenList;
enum class SHOWTIME_MODES;
struct FileSettings;
class CheckUnusedFunctions;
class Tokenizer;

/// @addtogroup Core
/// @{
Expand Down
2 changes: 1 addition & 1 deletion lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "standards.h"
#include "suppressions.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"

#include <algorithm>
Expand Down
1 change: 1 addition & 0 deletions lib/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "standards.h"

#include <climits>
#include <cstddef>
#include <stdexcept>
#include <string>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions lib/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <algorithm>
#include <array>
#include <cstddef>
#include <iterator>
#include <sstream>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <tuple>
#include <vector>
#include <unordered_set>
#include <utility>

enum class SHOWTIME_MODES;
namespace ValueFlow {
Expand Down
1 change: 0 additions & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//---------------------------------------------------------------------------
#include "tokenize.h"

#include "check.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "library.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/tokenize.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TimerResults;
class Token;
class TemplateSimplifier;
class ErrorLogger;
struct Directive;
struct Directive; // IWYU pragma: keep
enum class Severity;

/// @addtogroup Core
Expand Down
4 changes: 2 additions & 2 deletions oss-fuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ tinyxml2.o: ../externals/tinyxml2/tinyxml2.cpp ../externals/tinyxml2/tinyxml2.h
$(libcppdir)/valueflow.o: ../lib/valueflow.cpp ../lib/addoninfo.h ../lib/analyzer.h ../lib/astutils.h ../lib/calculate.h ../lib/check.h ../lib/checkuninitvar.h ../lib/color.h ../lib/config.h ../lib/errorlogger.h ../lib/errortypes.h ../lib/findtoken.h ../lib/forwardanalyzer.h ../lib/infer.h ../lib/library.h ../lib/mathlib.h ../lib/path.h ../lib/platform.h ../lib/programmemory.h ../lib/reverseanalyzer.h ../lib/settings.h ../lib/smallvector.h ../lib/sourcelocation.h ../lib/standards.h ../lib/suppressions.h ../lib/symboldatabase.h ../lib/templatesimplifier.h ../lib/timer.h ../lib/token.h ../lib/tokenize.h ../lib/tokenlist.h ../lib/utils.h ../lib/valueflow.h ../lib/valueptr.h ../lib/vfvalue.h
$(CXX) ${LIB_FUZZING_ENGINE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/valueflow.cpp

$(libcppdir)/tokenize.o: ../lib/tokenize.cpp ../externals/simplecpp/simplecpp.h ../lib/addoninfo.h ../lib/check.h ../lib/color.h ../lib/config.h ../lib/errorlogger.h ../lib/errortypes.h ../lib/library.h ../lib/mathlib.h ../lib/platform.h ../lib/preprocessor.h ../lib/settings.h ../lib/sourcelocation.h ../lib/standards.h ../lib/summaries.h ../lib/suppressions.h ../lib/symboldatabase.h ../lib/templatesimplifier.h ../lib/timer.h ../lib/token.h ../lib/tokenize.h ../lib/tokenlist.h ../lib/utils.h ../lib/valueflow.h ../lib/vfvalue.h
$(libcppdir)/tokenize.o: ../lib/tokenize.cpp ../externals/simplecpp/simplecpp.h ../lib/addoninfo.h ../lib/color.h ../lib/config.h ../lib/errorlogger.h ../lib/errortypes.h ../lib/library.h ../lib/mathlib.h ../lib/platform.h ../lib/preprocessor.h ../lib/settings.h ../lib/sourcelocation.h ../lib/standards.h ../lib/summaries.h ../lib/suppressions.h ../lib/symboldatabase.h ../lib/templatesimplifier.h ../lib/timer.h ../lib/token.h ../lib/tokenize.h ../lib/tokenlist.h ../lib/utils.h ../lib/valueflow.h ../lib/vfvalue.h
$(CXX) ${LIB_FUZZING_ENGINE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/tokenize.cpp

$(libcppdir)/symboldatabase.o: ../lib/symboldatabase.cpp ../lib/addoninfo.h ../lib/astutils.h ../lib/color.h ../lib/config.h ../lib/errorlogger.h ../lib/errortypes.h ../lib/keywords.h ../lib/library.h ../lib/mathlib.h ../lib/path.h ../lib/platform.h ../lib/settings.h ../lib/smallvector.h ../lib/sourcelocation.h ../lib/standards.h ../lib/suppressions.h ../lib/symboldatabase.h ../lib/templatesimplifier.h ../lib/token.h ../lib/tokenize.h ../lib/tokenlist.h ../lib/utils.h ../lib/valueflow.h ../lib/vfvalue.h
Expand Down Expand Up @@ -265,7 +265,7 @@ $(libcppdir)/forwardanalyzer.o: ../lib/forwardanalyzer.cpp ../lib/addoninfo.h ..
$(libcppdir)/fwdanalysis.o: ../lib/fwdanalysis.cpp ../lib/astutils.h ../lib/config.h ../lib/errortypes.h ../lib/fwdanalysis.h ../lib/library.h ../lib/mathlib.h ../lib/smallvector.h ../lib/sourcelocation.h ../lib/standards.h ../lib/symboldatabase.h ../lib/templatesimplifier.h ../lib/token.h ../lib/utils.h ../lib/vfvalue.h
$(CXX) ${LIB_FUZZING_ENGINE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/fwdanalysis.cpp

$(libcppdir)/importproject.o: ../lib/importproject.cpp ../externals/picojson/picojson.h ../externals/tinyxml2/tinyxml2.h ../lib/addoninfo.h ../lib/config.h ../lib/errortypes.h ../lib/filesettings.h ../lib/importproject.h ../lib/json.h ../lib/library.h ../lib/mathlib.h ../lib/path.h ../lib/platform.h ../lib/settings.h ../lib/standards.h ../lib/suppressions.h ../lib/templatesimplifier.h ../lib/token.h ../lib/tokenize.h ../lib/tokenlist.h ../lib/utils.h ../lib/vfvalue.h ../lib/xml.h
$(libcppdir)/importproject.o: ../lib/importproject.cpp ../externals/picojson/picojson.h ../externals/tinyxml2/tinyxml2.h ../lib/addoninfo.h ../lib/config.h ../lib/errortypes.h ../lib/filesettings.h ../lib/importproject.h ../lib/json.h ../lib/library.h ../lib/mathlib.h ../lib/path.h ../lib/platform.h ../lib/settings.h ../lib/standards.h ../lib/suppressions.h ../lib/templatesimplifier.h ../lib/token.h ../lib/tokenlist.h ../lib/utils.h ../lib/vfvalue.h ../lib/xml.h
$(CXX) ${LIB_FUZZING_ENGINE} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/importproject.cpp

$(libcppdir)/infer.o: ../lib/infer.cpp ../lib/calculate.h ../lib/config.h ../lib/errortypes.h ../lib/infer.h ../lib/mathlib.h ../lib/valueptr.h ../lib/vfvalue.h
Expand Down
4 changes: 3 additions & 1 deletion test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
#ifndef helpersH
#define helpersH

#include "preprocessor.h"
#include "config.h"
#include "settings.h"
#include "standards.h"
#include "tokenize.h"
#include "tokenlist.h"

#include <cstddef>
#include <map>
#include <set>
#include <stdexcept>
#include <sstream>
#include <string>
Expand Down
2 changes: 2 additions & 0 deletions test/testclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "helpers.h"
#include "settings.h"
#include "tokenize.h"
#include "tokenlist.h"

#include <list>
#include <sstream>
#include <string>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion test/testfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "settings.h"
#include "standards.h"

#include <sstream>
#include <string>

class TestFunctions : public TestFixture {
Expand Down
1 change: 0 additions & 1 deletion test/testgarbage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "token.h"

#include <list>
#include <sstream>
#include <string>

class TestGarbage : public TestFixture {
Expand Down
1 change: 0 additions & 1 deletion test/testincompletestatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "fixture.h"
#include "tokenize.h"

#include <sstream>
#include <string>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion test/testleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include "checkleakautovar.h"
#include "errortypes.h"
#include "fixture.h"
#include "helpers.h"
#include "settings.h"
Expand Down
1 change: 0 additions & 1 deletion test/testmathlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include "config.h"
#include "errortypes.h"
#include "mathlib.h"
#include "fixture.h"

Expand Down
2 changes: 0 additions & 2 deletions test/testsimplifytokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include "standards.h"
#include "fixture.h"
#include "token.h"
#include "tokenize.h"

#include <sstream>
#include <string>


Expand Down
1 change: 1 addition & 0 deletions test/testsimplifyusing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "settings.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"

#include <sstream>
Expand Down
1 change: 0 additions & 1 deletion test/teststl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "helpers.h"
#include "settings.h"
#include "standards.h"
#include "tokenize.h"
#include "utils.h"

#include <cstddef>
Expand Down
1 change: 0 additions & 1 deletion test/teststring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "fixture.h"
#include "tokenize.h"

#include <sstream>
#include <string>
#include <vector>

Expand Down
2 changes: 0 additions & 2 deletions test/testsummaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

#include "fixture.h"
#include "helpers.h"
#include "settings.h"
#include "summaries.h"
#include "tokenize.h"

#include <string>

Expand Down
1 change: 0 additions & 1 deletion test/testthreadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "threadexecutor.h"
#include "timer.h"

#include <algorithm>
#include <cstdlib>
#include <list>
#include <memory>
Expand Down
2 changes: 0 additions & 2 deletions test/testtoken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "errortypes.h"
#include "fixture.h"
#include "helpers.h"
#include "settings.h"
#include "standards.h"
#include "token.h"
#include "tokenlist.h"
Expand Down
3 changes: 3 additions & 0 deletions test/testtokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#include <simplecpp.h>

class TestTokenizer : public TestFixture {
public:
TestTokenizer() : TestFixture("TestTokenizer") {}
Expand Down
3 changes: 0 additions & 3 deletions test/testtokenrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "settings.h"
#include "fixture.h"
#include "helpers.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "tokenrange.h"
#include "symboldatabase.h"

Expand Down
2 changes: 0 additions & 2 deletions test/testuninitvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
#include "check.h"
#include "checkuninitvar.h"
#include "ctu.h"
#include "errortypes.h"
#include "fixture.h"
#include "helpers.h"
#include "settings.h"
#include "tokenize.h"

#include <list>
#include <string>
Expand Down
2 changes: 2 additions & 0 deletions test/testunusedfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "platform.h"
#include "settings.h"
#include "tokenize.h"
#include "tokenlist.h"

#include <sstream>
#include <string>

class TestUnusedFunctions : public TestFixture {
Expand Down
1 change: 0 additions & 1 deletion test/testunusedprivfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "fixture.h"
#include "tokenize.h"

#include <sstream>
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion test/testvarid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "errortypes.h"
#include "helpers.h"
#include "platform.h"
#include "settings.h"
#include "standards.h"
#include "fixture.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"

#include <sstream>
#include <string>
Expand Down

0 comments on commit 6d3d868

Please sign in to comment.