cleaned up includes based on `include-what-you-use` (#4599)

This commit is contained in:
Oliver Stöneberg 2023-03-02 21:50:14 +01:00 committed by GitHub
parent 68504a0f51
commit bd1ae69b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 93 additions and 14 deletions

View File

@ -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: |
@ -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

View File

@ -505,7 +505,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

View File

@ -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

View File

@ -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

View File

@ -18,6 +18,8 @@
#pragma once
// IWYU pragma: begin_keep
#include "config.h"
#include "cppcheck.h"
#include "settings.h"
// IWYU pragma: end_keep

View File

@ -43,6 +43,7 @@
#include <sys/select.h>
#include <sys/wait.h>
#include <unistd.h>
#include <utility>
#include <fcntl.h>

View File

@ -18,6 +18,7 @@
#pragma once
// IWYU pragma: begin_keep
#include "checkthread.h"
#include "codeeditor.h"
#include "codeeditorstyle.h"
@ -29,3 +30,4 @@
#include <QFile>
#include <QVariant>
// IWYU pragma: end_keep

View File

@ -23,7 +23,6 @@
#include "resultsview.h"
#include "settings.h"
#include <list>
#include <string>
#include <utility>

View File

@ -26,8 +26,10 @@
#include "tokenize.h"
#include "vfvalue.h"
#include <algorithm>
#include <cctype>
#include <iostream>
#include <stdexcept>
#include <utility>
//---------------------------------------------------------------------------

View File

@ -31,6 +31,7 @@
#include "valueflow.h"
#include "vfvalue.h"
#include <algorithm>
#include <list>
#include <unordered_set>
#include <utility>

View File

@ -36,6 +36,7 @@
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <memory>
#include <utility>
#include <unordered_map>

View File

@ -19,6 +19,8 @@
//---------------------------------------------------------------------------
#include "checkexceptionsafety.h"
#include "errortypes.h"
#include "library.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"

View File

@ -23,7 +23,6 @@
#include "check.h"
#include "config.h"
#include "errortypes.h"
#include "tokenize.h"
#include <string>

View File

@ -32,6 +32,7 @@
#include "vfvalue.h"
#include <iomanip>
#include <list>
#include <sstream>
#include <unordered_map>
#include <vector>

View File

@ -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

View File

@ -32,7 +32,9 @@
#include "token.h"
#include "tokenize.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <iostream>
#include <list>
#include <memory>

View File

@ -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()

View File

@ -26,6 +26,8 @@
#include "token.h"
#include "tokenize.h"
#include <algorithm>
#include <iterator>
#include <map>
#include <vector>

View File

@ -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>

View File

@ -33,6 +33,7 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>

View File

@ -44,6 +44,7 @@
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <exception>
#include <fstream>
#include <iostream> // <- TEMPORARY
@ -53,6 +54,7 @@
#include <sstream> // IWYU pragma: keep
#include <stdexcept>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

View File

@ -32,7 +32,6 @@
#include <cstddef>
#include <fstream> // IWYU pragma: keep
#include <functional>
#include <iosfwd>
#include <list>
#include <map>
#include <string>

View File

@ -32,6 +32,7 @@
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <limits>
#include <memory>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -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)
{

View File

@ -33,6 +33,7 @@
#include <iostream>
#include <iterator>
#include <sstream> // IWYU pragma: keep
#include <unordered_set>
#include <utility>
#include <tinyxml2.h>

View File

@ -28,6 +28,7 @@
#include "valueflow.h"
#include "vfvalue.h"
#include <algorithm>
#include <cctype>
#include <climits>
#include <cstdlib>

View File

@ -23,6 +23,7 @@
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <exception>
#include <limits>

View File

@ -17,6 +17,8 @@
*/
#pragma once
// IWYU pragma: begin_keep
#include "astutils.h"
#include "errorlogger.h"
#include "library.h"
@ -27,3 +29,4 @@
#include "suppressions.h"
#include "utils.h"
#include "valueflow.h"
// IWYU pragma: end_keep

View File

@ -32,6 +32,7 @@
#include <algorithm>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <list>
#include <set>

View File

@ -45,6 +45,7 @@
#include <sstream> // IWYU pragma: keep
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

View File

@ -28,6 +28,7 @@
#include "sourcelocation.h"
#include "token.h"
#include <algorithm>
#include <cctype>
#include <iosfwd>
#include <list>

View File

@ -40,7 +40,9 @@
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <exception>
#include <memory>
#include <set>

View File

@ -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"
@ -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>

View File

@ -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:

View File

@ -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

View File

@ -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;

View File

@ -18,6 +18,7 @@
#pragma once
// IWYU pragma: begin_keep
#include "check.h"
#include "config.h"
#include "importproject.h"
@ -28,3 +29,4 @@
#include "token.h"
#include "tokenlist.h"
#include "tokenize.h"
// IWYU pragma: end_keep

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
class TestAutoVariables : public TestFixture {

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
class TestBool : public TestFixture {

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
class TestBoost : public TestFixture {

View File

@ -15,7 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "clangimport.h"
#include "platform.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"

View File

@ -27,6 +27,7 @@
#include "fixture.h"
#include "timer.h"
#include <cstdint>
#include <cstdio>
#include <list>
#include <set>

View File

@ -25,6 +25,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
class TestExceptionSafety : public TestFixture {

View File

@ -21,7 +21,9 @@
#include "tokenize.h"
#include "checkinternal.h"
#include "fixture.h"
#include "settings.h"
#include <list>
#include <sstream>
class TestInternal : public TestFixture {

View File

@ -18,15 +18,16 @@
#include "checkleakautovar.h"
#include "errortypes.h"
#include "library.h"
#include "settings.h"
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
@ -36,6 +37,7 @@
class TestLeakAutoVarStrcpy;
class TestLeakAutoVarWindows;
struct InternalError;
class TestLeakAutoVar : public TestFixture {
public:

View File

@ -26,6 +26,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -22,6 +22,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -25,6 +25,7 @@
#include "utils.h"
#include <cstddef>
#include <list>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep

View File

@ -26,6 +26,7 @@
#include "tokenize.h"
#include "tokenlist.h"
#include <cstring>
#include <list>
#include <map>
#include <set>

View File

@ -24,6 +24,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
#include <string>

View File

@ -18,6 +18,7 @@
#include "helpers.h"
#include "fixture.h"
#include "settings.h"
#include "utils.h"
const Settings givenACodeSampleToTokenize::settings;

View File

@ -23,6 +23,7 @@
#include "fixture.h"
#include "tokenize.h"
#include <list>
#include <sstream> // IWYU pragma: keep
class TestVaarg : public TestFixture {

View File

@ -20,12 +20,18 @@
#include <algorithm>
#include <array>
#include <cstdlib>
#include <fstream> // IWYU pragma: keep
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "config.h"
#include "../cli/filelister.h"
#include "../lib/pathmatch.h"
#include "../lib/utils.h"