Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
make -C cmake.output autogen
# make sure the auto-generated GUI dependencies exist
make -C cmake.output gui-build-deps
make -C cmake.output triage-build-ui-deps

- name: Build Qt mappings
run: |
Expand All @@ -52,6 +53,11 @@ jobs:
# do not fail for now so the output is being saved
iwyu_tool -p cmake.output -j $(nproc) -- -w > iwyu.log || true

- uses: actions/upload-artifact@v3
with:
name: Compilation Database
path: ./cmake.output/compile_commands.json

- uses: actions/upload-artifact@v3
with:
name: Qt Mappings
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ $(libcppdir)/checkmemoryleak.o: lib/checkmemoryleak.cpp lib/astutils.h lib/check
$(libcppdir)/checknullpointer.o: lib/checknullpointer.cpp lib/astutils.h lib/check.h lib/checknullpointer.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.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/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checknullpointer.cpp

$(libcppdir)/checkother.o: lib/checkother.cpp lib/astutils.h lib/check.h lib/checkclass.h lib/checkother.h lib/checkuninitvar.h lib/color.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/fwdanalysis.h lib/importproject.h lib/library.h lib/mathlib.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/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(libcppdir)/checkother.o: lib/checkother.cpp lib/astutils.h lib/check.h lib/checkclass.h lib/checkother.h lib/config.h lib/errortypes.h lib/fwdanalysis.h lib/importproject.h lib/library.h lib/mathlib.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/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/checkother.cpp

$(libcppdir)/checkpostfixoperator.o: lib/checkpostfixoperator.cpp lib/check.h lib/checkpostfixoperator.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.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/vfvalue.h
Expand Down
5 changes: 4 additions & 1 deletion cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@
#include <cstdio>
#include <cstdlib> // EXIT_FAILURE
#include <cstring>
#include <fstream>
#include <fstream> // IWYU pragma: keep
#include <iostream>
#include <iterator>
#include <list>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <stdexcept>
#include <unordered_set>
#include <utility>

#ifdef HAVE_RULES
Expand Down
2 changes: 2 additions & 0 deletions cli/cppcheckexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
#include "processexecutor.h"
#endif

#include <algorithm>
#include <atomic>
#include <cstdio>
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <memory>
#include <sstream> // IWYU pragma: keep
Expand Down
2 changes: 2 additions & 0 deletions cli/precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#pragma once

// IWYU pragma: begin_keep
#include "config.h"
#include "cppcheck.h"
#include "settings.h"
// IWYU pragma: end_keep
1 change: 1 addition & 0 deletions cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <sys/select.h>
#include <sys/wait.h>
#include <unistd.h>
#include <utility>
#include <fcntl.h>


Expand Down
2 changes: 2 additions & 0 deletions gui/precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#pragma once

// IWYU pragma: begin_keep
#include "checkthread.h"
#include "codeeditor.h"
#include "codeeditorstyle.h"
Expand All @@ -29,3 +30,4 @@

#include <QFile>
#include <QVariant>
// IWYU pragma: end_keep
1 change: 0 additions & 1 deletion gui/threadhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "resultsview.h"
#include "settings.h"

#include <list>
#include <string>
#include <utility>

Expand Down
2 changes: 2 additions & 0 deletions lib/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
#include "tokenize.h"
#include "vfvalue.h"

#include <algorithm>
#include <cctype>
#include <iostream>
#include <stdexcept>
#include <utility>

//---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions lib/checkautovariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "valueflow.h"
#include "vfvalue.h"

#include <algorithm>
#include <list>
#include <unordered_set>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <memory>
#include <utility>
#include <unordered_map>
Expand Down
2 changes: 2 additions & 0 deletions lib/checkexceptionsafety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
//---------------------------------------------------------------------------
#include "checkexceptionsafety.h"

#include "errortypes.h"
#include "library.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"
Expand Down
1 change: 0 additions & 1 deletion lib/checkexceptionsafety.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "check.h"
#include "config.h"
#include "errortypes.h"
#include "tokenize.h"

#include <string>
Expand Down
1 change: 1 addition & 0 deletions lib/checkfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "vfvalue.h"

#include <iomanip>
#include <list>
#include <sstream>
#include <unordered_map>
#include <vector>
Expand Down
3 changes: 2 additions & 1 deletion lib/checkinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
#include "token.h"
#include "tokenize.h"

#include <set>
#include <cstring>
#include <set>
#include <vector>

// Register this check class (by creating a static instance of it).
// Disabled in release builds
Expand Down
2 changes: 2 additions & 0 deletions lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include "token.h"
#include "tokenize.h"

#include <algorithm>
#include <array>
#include <cstddef>
#include <iostream>
#include <list>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueflow.h"
#include "vfvalue.h"

#include "checkuninitvar.h" // CheckUninitVar::isVariableUsage
#include "checkclass.h" // CheckClass::stl_containers_not_const

#include <algorithm> // find_if()
Expand Down
2 changes: 2 additions & 0 deletions lib/checksizeof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "token.h"
#include "tokenize.h"

#include <algorithm>
#include <iterator>
#include <map>
#include <vector>

Expand Down
2 changes: 2 additions & 0 deletions lib/checkunusedfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
#include <cstdlib>
#include <cstring>
#include <fstream> // IWYU pragma: keep
#include <map>
#include <memory>
#include <sstream> // IWYU pragma: keep
#include <tuple>
#include <utility>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions lib/clangimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
Expand Down
2 changes: 2 additions & 0 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <exception>
#include <fstream>
#include <iostream> // <- TEMPORARY
Expand All @@ -53,6 +54,7 @@
#include <sstream> // IWYU pragma: keep
#include <stdexcept>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <cstddef>
#include <fstream> // IWYU pragma: keep
#include <functional>
#include <iosfwd>
#include <list>
#include <map>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions lib/errorlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <limits>
#include <memory>
#include <sstream> // IWYU pragma: keep
#include <string>
Expand Down
4 changes: 4 additions & 0 deletions lib/fwdanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
#include "token.h"
#include "vfvalue.h"

#include <list>
#include <map>
#include <memory>
#include <string>
#include <utility>

static bool isUnchanged(const Token *startToken, const Token *endToken, const std::set<nonneg int> &exprVarIds, bool local)
{
Expand Down
1 change: 1 addition & 0 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <iostream>
#include <iterator>
#include <sstream> // IWYU pragma: keep
#include <unordered_set>
#include <utility>

#include <tinyxml2.h>
Expand Down
1 change: 1 addition & 0 deletions lib/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "valueflow.h"
#include "vfvalue.h"

#include <algorithm>
#include <cctype>
#include <climits>
#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions lib/mathlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <exception>
#include <limits>
Expand Down
3 changes: 3 additions & 0 deletions lib/precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/

#pragma once

// IWYU pragma: begin_keep
#include "astutils.h"
#include "errorlogger.h"
#include "library.h"
Expand All @@ -27,3 +29,4 @@
#include "suppressions.h"
#include "utils.h"
#include "valueflow.h"
// IWYU pragma: end_keep
1 change: 1 addition & 0 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <algorithm>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <list>
#include <set>
Expand Down
1 change: 1 addition & 0 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <sstream> // IWYU pragma: keep
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
Expand Down
1 change: 1 addition & 0 deletions lib/symboldatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "sourcelocation.h"
#include "token.h"

#include <algorithm>
#include <cctype>
#include <iosfwd>
#include <list>
Expand Down
2 changes: 2 additions & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <exception>
#include <memory>
#include <set>
Expand Down
3 changes: 2 additions & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#include "programmemory.h"
#include "reverseanalyzer.h"
#include "settings.h"
#include "smallvector.h"
#include "sourcelocation.h"
#include "standards.h"
#include "symboldatabase.h"
Expand All @@ -106,13 +107,13 @@
#include <array>
#include <cassert>
#include <climits>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <exception>
#include <functional>
#include <initializer_list>
#include <iosfwd>
#include <iterator>
#include <limits>
#include <map>
Expand Down
4 changes: 4 additions & 0 deletions test/fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
#include "errorlogger.h"

#include <cstddef>
#include <list>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>

class options;
class Settings;
class Tokenizer;

class TestFixture : public ErrorLogger {
private:
Expand Down
5 changes: 4 additions & 1 deletion test/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@

#include "path.h"

#include <cstdio>
#include <stdexcept>
#include <utility>

#ifdef _WIN32
#include <windows.h>
#else
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#endif

Expand Down
5 changes: 2 additions & 3 deletions test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
#include "tokenize.h"
#include "tokenlist.h"

#include <cstdio>
#include <fstream>
#include <fstream> // IWYU pragma: keep
#include <list>
#include <sstream> // IWYU pragma: keep
#include <string>
#include <utility>


class Token;

Expand Down
Loading