Skip to content

Commit

Permalink
Merge pull request #6164 from knelli2/iwyu
Browse files Browse the repository at this point in the history
Remove IWYU
  • Loading branch information
wthrowe authored Jul 26, 2024
2 parents 1c92996 + 4e3f936 commit f728c6c
Show file tree
Hide file tree
Showing 574 changed files with 912 additions and 10,081 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ include(UpdateAddExecutables)
# dependencies on the PCH if necessary.
include(SetupClangFormat)
include(SetupClangTidy)
include(SetupIwyu)
if(BUILD_DOCS)
include(SetupDoxygen)
include(SetupSphinx)
Expand Down
90 changes: 0 additions & 90 deletions cmake/SetupIwyu.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions docs/DevGuide/BuildSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,12 @@ cmake -D FLAG1=OPT1 ... -D FLAGN=OPTN <SPECTRE_ROOT>
also run automatically on \ref github_actions_guide "CI" and must pass
before pull requests are merged.
(default is `ON`)
- USE_IWYU
- Enable [include-what-you-use (IWYU)](https://github.com/include-what-you-use/include-what-you-use)
tools. (default is `OFF`)
- USE_LD
- Override the automatically chosen linker. The options are `ld`, `gold`, and
`lld`.
(default is `OFF`)
- USE_PCH
- Whether or not to use pre-compiled headers (default is `ON`)
- This needs to be turned `OFF` in order to use
[include-what-you-use
(IWYU)](https://github.com/include-what-you-use/include-what-you-use)
- USE_SLEEF
- Whether to use [Sleef](https://github.com/shibatch/sleef) with Blaze to
vectorize addition math functions like `sin`, `cos`, and `exp`.
Expand Down
14 changes: 0 additions & 14 deletions docs/DevGuide/GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@ is useful to perform at least the following tests locally:
`index.html` file in the `html` subdirectory in a browser. Some functionality
requires a web server (e.g. citation popovers), so just run a
`python3 -m http.server` in the `html` directory to enable this.
- **IWYU:** We experimented for a time using IWYU (include what you
use) as an automated check for correct includes and forward
declarations. Unfortunately it gave many incorrect suggestions. We
have decided to no longer have a IWYU check with GitHub Actions, but have
left support for IWYU so that it can be used locally. To do so just
for the changed files in a pull request run `make iwyu-hash
HASH=UPSTREAM_HEAD`. Since IWYU requires `USE_PCH=OFF` you can
create a separate build directory and append `-D USE_PCH=OFF` to the
usual `cmake` call. Note that it is very easy to incorrectly install
IWYU (if not using the Docker container) and generate nonsense
errors. Note that we have left IWYU pragmas in the code, but no
longer require they be added so that IWYU gives no errors when run.
As IWYU is still under development, we plan to investigate using it
again in the future.
- The `gcc Debug` build runs code coverage for each GitHub Actions build.

## Troubleshooting {#github-actions-troubleshooting}
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/ApplyMatrices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// \cond
template <size_t Dim>
class Index;
// IWYU pragma: no_forward_declare Variables

/// \endcond

namespace apply_matrices_detail {
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/CachedTempBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <cstddef>
#include <utility> // IWYU pragma: keep // for std::move
#include <utility>

#include "DataStructures/TempBuffer.hpp"
#include "Utilities/Gsl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/ComplexDataVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <blaze/math/GroupTag.h>
#include <complex>
#include <cstddef>
#include <functional> // for std::reference_wrapper
#include <functional>

#include "DataStructures/DataVector.hpp"
#include "DataStructures/VectorImpl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/ComplexDiagonalModalOperator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "DataStructures/ComplexModalVector.hpp"
#include "DataStructures/DataVector.hpp" // IWYU pragma: keep
#include "DataStructures/DataVector.hpp"
#include "DataStructures/DiagonalModalOperator.hpp"
#include "DataStructures/VectorImpl.hpp"
#include "Utilities/TMPL.hpp"
Expand Down
3 changes: 0 additions & 3 deletions src/DataStructures/DataBox/DataBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include "Utilities/TypeTraits/IsA.hpp"
#include "Utilities/TypeTraits/IsCallable.hpp"

// IWYU pragma: no_forward_declare brigand::get_destination
// IWYU pragma: no_forward_declare brigand::get_source

/*!
* \ingroup DataBoxGroup
* \brief Namespace for DataBox related things
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/DataBox/Prefixes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/// \cond
template <class>
class Variables; // IWYU pragma: keep
class Variables;
/// \endcond

namespace Tags {
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/DiagonalModalOperator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "DataStructures/DataVector.hpp" // IWYU pragma: keep
#include "DataStructures/DataVector.hpp"
#include "DataStructures/VectorImpl.hpp"
#include "Utilities/TMPL.hpp"

Expand Down
4 changes: 2 additions & 2 deletions src/DataStructures/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#include "DataStructures/Index.hpp"

#include <pup.h> // IWYU pragma: keep
#include <pup.h>
#include <pup_stl.h>

#include "Utilities/GenerateInstantiations.hpp"
#include "Utilities/StdHelpers.hpp" // IWYU pragma: keep
#include "Utilities/StdHelpers.hpp"

template <size_t Dim>
void Index<Dim>::pup(PUP::er& p) {
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/Index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeArray.hpp"
#include "Utilities/Requires.hpp"
#include "Utilities/TypeTraits.hpp" // IWYU pragma: keep
#include "Utilities/TypeTraits.hpp"
#include "Utilities/TypeTraits/IsInteger.hpp"

namespace PUP {
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/SliceIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <functional>
#include <numeric>

#include "DataStructures/Index.hpp" // IWYU pragma: keep
#include "DataStructures/Index.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
#include "Utilities/GenerateInstantiations.hpp"
#include "Utilities/Gsl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/StripeIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <functional>
#include <numeric>

#include "DataStructures/Index.hpp" // IWYU pragma: keep
#include "DataStructures/Index.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/Literals.hpp"

Expand Down
2 changes: 0 additions & 2 deletions src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "Utilities/MakeWithValue.hpp"
#include "Utilities/TMPL.hpp"

// IWYU pragma: no_forward_declare Tensor

/// @{
/*!
* \ingroup GeneralRelativityGroup
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/Tensor/IndexType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <string>
#include <type_traits>

#include "Utilities/Literals.hpp" // IWYU pragma: keep
#include "Utilities/Literals.hpp"
#include "Utilities/TMPL.hpp"

/// \ingroup TensorGroup
Expand Down
2 changes: 1 addition & 1 deletion src/DataStructures/Tensor/Structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "DataStructures/Tensor/IndexType.hpp"
#include "DataStructures/Tensor/Metafunctions.hpp"
#include "DataStructures/Tensor/Symmetry.hpp"
#include "Utilities/Array.hpp" // IWYU pragma: export
#include "Utilities/Array.hpp"
#include "Utilities/ConstantExpressions.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
#include "Utilities/ForceInline.hpp"
Expand Down
3 changes: 0 additions & 3 deletions src/DataStructures/Variables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
#include "Utilities/TypeTraits.hpp"
#include "Utilities/TypeTraits/IsA.hpp"

// IWYU pragma: no_forward_declare MakeWithValueImpl
// IWYU pragma: no_forward_declare Variables

/// \cond
template <typename X, typename Symm, typename IndexList>
class Tensor;
Expand Down
6 changes: 3 additions & 3 deletions src/DataStructures/VectorImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <algorithm> // IWYU pragma: keep // for std::fill
#include <algorithm>
#include <array>
#include <blaze/math/AlignmentFlag.h>
#include <blaze/math/CustomVector.h>
Expand All @@ -13,7 +13,7 @@
#include <blaze/math/TransposeFlag.h>
#include <cstddef>
#include <cstring>
#include <functional> // IWYU pragma: keep // for std::plus, etc.
#include <functional>
#include <initializer_list>
#include <limits>
#include <memory>
Expand All @@ -26,7 +26,7 @@
#include "Utilities/ForceInline.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/MakeWithValue.hpp" // IWYU pragma: keep
#include "Utilities/MakeWithValue.hpp"
#include "Utilities/MemoryHelpers.hpp"
#include "Utilities/PrintHelpers.hpp"
#include "Utilities/Requires.hpp"
Expand Down
6 changes: 3 additions & 3 deletions src/Domain/Amr/UpdateAmrDecision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include "Domain/Amr/Flag.hpp"
#include "Domain/Amr/Helpers.hpp"
#include "Domain/Structure/Direction.hpp"
#include "Domain/Structure/Element.hpp" // IWYU pragma: keep
#include "Domain/Structure/ElementId.hpp" // IWYU pragma: keep
#include "Domain/Structure/Neighbors.hpp" // IWYU pragma: keep
#include "Domain/Structure/Element.hpp"
#include "Domain/Structure/ElementId.hpp"
#include "Domain/Structure/Neighbors.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
#include "Utilities/GenerateInstantiations.hpp"
#include "Utilities/Gsl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <ios>
#include <memory>
#include <ostream>
#include <pup.h> // IWYU pragma: keep
#include <pup.h>
#include <typeinfo>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/BlockLogicalCoordinates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "DataStructures/Tensor/Tensor.hpp"
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "Domain/Block.hpp"
#include "Domain/Domain.hpp" // IWYU pragma: keep
#include "Domain/Domain.hpp"
#include "Domain/FunctionsOfTime/FunctionOfTime.hpp"
#include "Domain/Structure/BlockId.hpp"
#include "Utilities/EqualWithinRoundoff.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/Domain/CoordinateMaps/Affine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include <pup.h>

#include "DataStructures/DataVector.hpp" // IWYU pragma: keep
#include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Tensor/Tensor.hpp"
#include "Utilities/DereferenceWrapper.hpp"
#include "Utilities/GenerateInstantiations.hpp"
#include "Utilities/MakeWithValue.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/CoordinateMaps/BulgedCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cmath>
#include <exception>
#include <functional> // for std::reference_wrapper
#include <functional>
#include <limits>
#include <optional>
#include <pup.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/CoordinateMaps/DiscreteRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Domain/CoordinateMaps/DiscreteRotation.hpp"

#include "DataStructures/Tensor/EagerMath/Determinant.hpp"
#include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep
#include "DataStructures/Tensor/Tensor.hpp"
#include "Domain/Structure/Direction.hpp"
#include "Domain/Structure/OrientationMap.hpp"
#include "Domain/Structure/Side.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/CoordinateMaps/EquatorialCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "Domain/CoordinateMaps/EquatorialCompression.hpp"

#include <cmath> // IWYU pragma: keep
#include <cmath>
#include <pup.h>

#include "DataStructures/Tensor/Tensor.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/Domain/CoordinateMaps/Equiangular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <cmath>
#include <pup.h>

#include "DataStructures/DataVector.hpp" // IWYU pragma: keep
#include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Tensor/Tensor.hpp"
#include "Utilities/ConstantExpressions.hpp"
#include "Utilities/DereferenceWrapper.hpp"
#include "Utilities/GenerateInstantiations.hpp"
Expand Down
Loading

0 comments on commit f728c6c

Please sign in to comment.