Skip to content

Commit

Permalink
Merge pull request #181 from eseiler/infra/iwyu_clang
Browse files Browse the repository at this point in the history
[INFRA] Run iwyu with libc++
  • Loading branch information
eseiler authored Dec 1, 2023
2 parents d96092f + 281ea5a commit 67fce2c
Show file tree
Hide file tree
Showing 44 changed files with 173 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
mkdir build
cd build
cmake ../hibf/test/iwyu -DCMAKE_BUILD_TYPE=Release \
-DHIBF_NATIVE_BUILD=OFF \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DHIBF_VERBOSE_TESTS=OFF
- name: Run Test
Expand Down
9 changes: 6 additions & 3 deletions include/hibf/contrib/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

#pragma once

#include <limits>
#include <memory>
#include <type_traits>
#include <algorithm> // for max
#include <cstddef> // for size_t
#include <limits> // for numeric_limits
#include <memory> // for pointer_traits
#include <new> // for align_val_t, bad_alloc
#include <type_traits> // for make_unsigned_t, true_type

// __cpp_aligned_new is a C++17 feature that we use in this allocator and we require it.
#if __cpp_aligned_new < 201606
Expand Down
8 changes: 4 additions & 4 deletions include/hibf/hierarchical_interleaved_bloom_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

#pragma once

#include <algorithm> // for max, __sort_fn, fill, sort
#include <algorithm> // for __fn, fill, sort
#include <cassert> // for assert
#include <cinttypes> // for int64_t, uint16_t
#include <concepts> // for integral, unsigned_integral
#include <cstddef> // for size_t
#include <functional> // for identity, less
#include <functional> // for less, identity
#include <memory> // for addressof
#include <ranges> // for forward_range, range, range_value_t
#include <utility> // for addressof
#include <vector> // for vector
#include <vector> // for vector, operator==

#include <hibf/cereal/concepts.hpp> // for cereal_archive
#include <hibf/config.hpp> // for config
Expand Down
4 changes: 2 additions & 2 deletions include/hibf/interleaved_bloom_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <cinttypes> // for uint16_t, uint64_t
#include <concepts> // for integral, same_as, unsigned_integral
#include <cstring> // for size_t
#include <ranges> // for range, forward_range, input_range, range_reference_t, range_value_t
#include <memory> // for addressof
#include <ranges> // for range, forward_range, input_range, range_reference_t, range_va...
#include <type_traits> // for remove_cvref_t
#include <utility> // for addressof
#include <vector> // for operator==, vector

#include <hibf/cereal/concepts.hpp> // for cereal_archive
Expand Down
3 changes: 1 addition & 2 deletions include/hibf/layout/data_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include <algorithm> // for copy, fill_n, max
#include <cassert> // for assert
#include <cinttypes> // for uint64_t
#include <cstddef> // for size_t
Expand All @@ -13,7 +12,7 @@
#include <vector> // for vector

#include <hibf/layout/layout.hpp> // for layout
#include <hibf/misc/timer.hpp> // for concurrent, timer
#include <hibf/misc/timer.hpp> // for concurrent_timer
#include <hibf/sketch/hyperloglog.hpp> // for hyperloglog

namespace seqan::hibf::layout
Expand Down
7 changes: 3 additions & 4 deletions include/hibf/layout/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

#pragma once

#include <algorithm> // for copy
#include <cstddef> // for size_t
#include <optional> // for nullopt, optional
#include <vector> // for vector
#include <cstddef> // for size_t
#include <optional> // for nullopt, optional
#include <vector> // for vector

#include <hibf/layout/layout.hpp> // for layout

Expand Down
3 changes: 2 additions & 1 deletion include/hibf/layout/hierarchical_binning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include <cassert> // for assert
#include <cstddef> // for size_t
#include <utility> // for addressof, pair
#include <memory> // for addressof
#include <utility> // for pair
#include <vector> // for vector

#include <hibf/build/bin_size_in_bits.hpp> // for bin_size_in_bits
Expand Down
11 changes: 5 additions & 6 deletions include/hibf/layout/layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

#pragma once

#include <algorithm> // for copy
#include <concepts> // for derived_from
#include <cstddef> // for size_t
#include <iosfwd> // for ostream
#include <vector> // for vector, operator==
#include <concepts> // for derived_from
#include <cstddef> // for size_t
#include <iosfwd> // for ostream, istream
#include <vector> // for operator==, vector

#include <hibf/layout/prefixes.hpp> // for header, merged_bin
#include <hibf/layout/prefixes.hpp> // for layout_fullest_technical_bin_idx, layout_header, layout_lower_level
#include <hibf/platform.hpp>

namespace seqan::hibf::layout
Expand Down
2 changes: 1 addition & 1 deletion include/hibf/layout/simple_binning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <cassert> // for assert
#include <cstddef> // for size_t
#include <memory> // for addressof
#include <stdexcept> // for runtime_error
#include <utility> // for addressof
#include <vector> // for vector

#include <hibf/layout/data_store.hpp> // for data_store
Expand Down
1 change: 1 addition & 0 deletions include/hibf/misc/counting_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#pragma once

#include <algorithm> // for transform
#include <bit> // for countr_zero
#include <cassert> // for assert
#include <cinttypes> // for uint64_t
Expand Down
3 changes: 1 addition & 2 deletions include/hibf/misc/insert_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

#pragma once

#include <algorithm> // for max
#include <cassert> // for assert
#include <cinttypes> // for uint64_t
#include <cstddef> // for ptrdiff_t
#include <iterator> // for output_iterator_tag
#include <utility> // for addressof, move
#include <memory> // for addressof
#include <vector> // for vector

#include <hibf/contrib/robin_hood.hpp> // for unordered_flat_set
Expand Down
4 changes: 1 addition & 3 deletions include/hibf/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#pragma once

#include <memory> // for allocator

// macro cruft
//!\cond
#define HIBF_STR_HELPER(x) #x
Expand Down Expand Up @@ -98,7 +96,7 @@
// ============================================================================

#if __has_include(<version>)
# include <version> // for _GLIBCXX_USE_CXX11_ABI, __cpp_lib_constexpr_vector
# include <version> // for __cpp_lib_constexpr_vector
#endif

// C++ standard [required]
Expand Down
5 changes: 2 additions & 3 deletions include/hibf/sketch/estimate_kmer_counts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

#pragma once

#include <algorithm> // for fill_n, max
#include <cstddef> // for size_t
#include <vector> // for vector
#include <cstddef> // for size_t
#include <vector> // for vector

#include <hibf/sketch/hyperloglog.hpp> // for hyperloglog

Expand Down
1 change: 0 additions & 1 deletion include/hibf/sketch/hyperloglog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#pragma once

#include <algorithm> // for copy
#include <array> // for array
#include <cinttypes> // for uint64_t, uint8_t
#include <cstddef> // for size_t
Expand Down
1 change: 0 additions & 1 deletion include/hibf/sketch/toolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include <algorithm> // for max
#include <cinttypes> // for uint64_t, int64_t
#include <cstddef> // for size_t
#include <functional> // for greater
Expand Down
9 changes: 4 additions & 5 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
// SPDX-License-Identifier: BSD-3-Clause

#include <cassert> // for assert
#include <cmath> // for ceil, sqrt
#include <cmath> // for sqrt, ceil
#include <functional> // for function
#include <iostream> // for basic_ostream, operator<<, basic_istream, stringstream, cerr, istream
#include <sstream> // for basic_stringstream
#include <iostream> // for operator<<, basic_ostream, basic_istream, getline, stringstream
#include <stdexcept> // for invalid_argument
#include <string> // for char_traits, getline, operator<<, string
#include <string_view> // for operator<<, operator==, basic_string_view
#include <string> // for char_traits, string
#include <string_view> // for operator==, basic_string_view

#include <hibf/config.hpp> // for config
#include <hibf/layout/prefixes.hpp> // for meta_header, meta_hibf_config_end, meta_hibf_config_start
Expand Down
6 changes: 3 additions & 3 deletions src/layout/compute_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#include <algorithm> // for __sort_fn, sort
#include <algorithm> // for __fn, sort
#include <cstddef> // for size_t
#include <functional> // for identity
#include <sstream> // for basic_stringstream, stringstream
#include <utility> // for addressof
#include <memory> // for addressof
#include <sstream> // for stringstream
#include <vector> // for vector

#include <hibf/config.hpp> // for config
Expand Down
4 changes: 2 additions & 2 deletions src/layout/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#include <algorithm> // for max, copy
#include <algorithm> // for max
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <initializer_list> // for initializer_list
#include <iterator> // for __fn, prev
#include <optional> // for optional, nullopt
#include <ranges> // for __prev_fn, prev
#include <vector> // for vector

#include <hibf/layout/graph.hpp> // for graph
Expand Down
1 change: 0 additions & 1 deletion src/sketch/compute_sketches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#include <algorithm> // for max, fill_n
#include <cinttypes> // for uint64_t
#include <cstddef> // for size_t
#include <functional> // for function
Expand Down
7 changes: 4 additions & 3 deletions src/sketch/hyperloglog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
// SPDX-FileCopyrightText: 2013 Hideaki Ohno <hide.o.j55{at}gmail.com>
// SPDX-License-Identifier: BSD-3-Clause AND MIT

#include <algorithm> // for max, __fill_fn, fill
#include <algorithm> // for max, __fn, fill
#include <array> // for array
#include <bit> // for countl_zero
#include <cassert> // for assert
#include <cinttypes> // for uint64_t, uint8_t, uint32_t
#include <cmath> // for log
#include <cstddef> // for size_t
#include <iostream> // for basic_ostream, basic_istream, basic_istream::read, basic_ostre...
#include <iostream> // for basic_ostream, basic_istream, istream, ostream
#include <memory> // for addressof
#include <stdexcept> // for runtime_error, invalid_argument
#include <utility> // for addressof, swap
#include <utility> // for swap
#include <vector> // for vector

#include <hibf/contrib/aligned_allocator.hpp> // for aligned_allocator
Expand Down
23 changes: 11 additions & 12 deletions src/sketch/toolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
// SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#include <algorithm> // for max, fill_n, sort
#include <cassert> // for assert
#include <cinttypes> // for uint64_t, int64_t
#include <cmath> // for floor, sqrt
#include <cstddef> // for size_t
#include <functional> // for greater
#include <limits> // for numeric_limits
#include <omp.h> // for omp_get_thread_num
#include <random> // for uniform_int_distribution, mt19937_64
#include <utility> // for swap, move
#include <vector> // for vector
#include <algorithm> // for sort
#include <cassert> // for assert
#include <cinttypes> // for uint64_t, int64_t
#include <cmath> // for sqrt, floor
#include <cstddef> // for size_t
#include <limits> // for numeric_limits
#include <omp.h> // for omp_get_thread_num
#include <random> // for uniform_int_distribution, mt19937_64
#include <utility> // for swap, move
#include <vector> // for vector

#include <hibf/contrib/robin_hood.hpp> // for unordered_flat_map, pair
#include <hibf/sketch/hyperloglog.hpp> // for hyperloglog
#include <hibf/sketch/toolbox.hpp> // for clustering_node, entry, neighbor, prio_queue, distance_matrix
#include <hibf/sketch/toolbox.hpp> // for clustering_node, entry, neighbor, prio_queue, distance_matrix, cluste...

namespace seqan::hibf::sketch::toolbox
{
Expand Down
4 changes: 2 additions & 2 deletions test/include/hibf/test/sandboxed_path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#pragma once

#include <filesystem> // for path, filesystem_error, operator/
#include <memory> // for allocator
#include <system_error> // for make_error_code, errc
#include <system_error> // for errc, make_error_code
#include <type_traits> // for __libcpp_remove_reference_t
#include <utility> // for move, forward

#include <hibf/platform.hpp>
Expand Down
5 changes: 2 additions & 3 deletions test/include/hibf/test/tmp_directory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#endif

#include <cassert> // for assert
#include <filesystem> // for exists, is_empty, path, remove_all, temp_directory_path, filesystem_...
#include <memory> // for allocator
#include <filesystem> // for path, exists, is_empty, remove_all, temp_directory_path, filesystem_...
#include <optional> // for optional, nullopt
#include <system_error> // for make_error_code, errc
#include <system_error> // for errc, make_error_code
#include <utility> // for exchange

#include <hibf/platform.hpp>
Expand Down
7 changes: 3 additions & 4 deletions test/include/hibf/test/type_name_as_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
#pragma once

#if defined(__GNUC__) || defined(__clang__)
# include <cxxabi.h> // for __cxa_demangle
# include <cxxabi.h> // for __cxa_demangle, abi
#endif // defined(__GNUC__) || defined(__clang__)

#include <cstdlib> // for free
#include <functional> // for function
#include <memory> // for allocator, unique_ptr
#include <string> // for operator+, char_traits, string, to_string
#include <memory> // for allocator, addressof, unique_ptr
#include <string> // for char_traits, operator+, string, to_string
#include <type_traits> // for remove_reference_t
#include <typeinfo> // for type_info
#include <utility> // for addressof

#include <hibf/platform.hpp>

Expand Down
19 changes: 0 additions & 19 deletions test/iwyu/mappings/gcc.stl.headers.imp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
{ include: ["<bits/c++0x_warning.h>", private, "<iosfwd>", public ] },
{ include: ["<bits/charconv.h>", private, "<charconv>", public ] },
{ include: ["<bits/char_traits.h>", private, "<string>", public ] },
{ include: ["<bits/chrono.h>", private, "<chrono>", public ] },
{ include: ["<bits/codecvt.h>", private, "<locale>", public ] },
{ include: ["<bits/concept_check.h>", private, "<iterator>", public ] },
{ include: ["<bits/cpp_type_traits.h>", private, "<ext/type_traits>", public ] },
Expand Down Expand Up @@ -298,24 +297,6 @@
{ include: ["<hashtable.h>", private, "<hash_set>", public ] },
# (This one should perhaps be found automatically somehow.)
{ include: ["<ext/sso_string_base.h>", private, "<string>", public ] },
# The iostream .h files are confusing. Lots of private headers,
# which are handled above, but we also have public headers
# #including each other (eg <iostream> //includes <istream>). We
# are pretty forgiving: if a user specifies any public header, we
# generally don't require the others.
# ( cd /usr/crosstool/v12/gcc-4.3.1-glibc-2.3.6-grte/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/include/c++/4.3.1 && egrep '^ *# *include <(istream|ostream|iostream|fstream|sstream|streambuf|ios|iosfwd)>' *stream* ios | perl -nle 'm/^([^:]+).*[<"]([^>"]+)[>"]/ and print qq@ { include: ["<$2>", public, "<$1>", public ] },@' | sort -u )
{ include: ["<ios>", public, "<istream>", public ] },
{ include: ["<ios>", public, "<ostream>", public ] },
{ include: ["<iosfwd>", public, "<ios>", public ] },
{ include: ["<iosfwd>", public, "<streambuf>", public ] },
{ include: ["<istream>", public, "<fstream>", public ] },
{ include: ["<istream>", public, "<iostream>", public ] },
{ include: ["<istream>", public, "<sstream>", public ] },
{ include: ["<ostream>", public, "<fstream>", public ] },
{ include: ["<ostream>", public, "<iostream>", public ] },
{ include: ["<ostream>", public, "<istream>", public ] },
{ include: ["<ostream>", public, "<sstream>", public ] },
{ include: ["<streambuf>", public, "<ios>", public ] },
# The location of exception_defines.h varies by GCC version. It should
# never be included directly.
{ include: ["<exception_defines.h>", private, "<exception>", public ] },
Expand Down
Loading

1 comment on commit 67fce2c

@vercel
Copy link

@vercel vercel bot commented on 67fce2c Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hibf – ./

hibf.vercel.app
hibf-seqan.vercel.app
hibf-git-main-seqan.vercel.app

Please sign in to comment.