Skip to content

Commit

Permalink
SERVER-77049 SERVER-77050 IWYU automated changes up to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoody256 authored and Evergreen Agent committed Jul 1, 2023
1 parent 482bf3a commit f8e4be7
Show file tree
Hide file tree
Showing 1,570 changed files with 18,561 additions and 4,416 deletions.
9 changes: 7 additions & 2 deletions buildscripts/iwyu/iwyu_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ no_includes:
- 'ext/alloc_traits\.h'
- 'ext/type_traits\.h'
- 'cxxabi\.h' # https://github.com/include-what-you-use/include-what-you-use/issues/909
- 'bits/.+'
- 'syscall\.h'
# arch specific
- 'boost/predef/hardware/simd/x86.+'
- 'emmintrin\.h'
Expand All @@ -38,16 +40,18 @@ no_includes:
# abuse of preprocessor
- 'mongo/db/namespace_string_reserved\.def\.h'

# prefixes (non regex) to skip
# path prefixes (non regex) to skip
skip_files:
- 'src/third_party'
- 'build/'
- 'src/mongo/tools/mongo_tidy_checks'
- 'src/mongo/util/net' # causes linkage issues
- 'src/mongo/util/text.cpp'
# IWYU confused on forward declares
- 'src/mongo/db/exec/near.cpp'
- 'src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp'
- 'src/mongo/transport/asio/asio_transport_layer.cpp'
# Asio is going to need some special treatment, the headers are very finicky
- 'src/mongo/transport/asio'
# causes IWYU to crash:
- 'src/mongo/db/update/update_internal_node.cpp'
- 'src/mongo/db/update/update_array_node.cpp'
Expand All @@ -64,6 +68,7 @@ keep_includes:
- '<fmt/printf\.h>'
- '<fmt/ranges\.h>'
- '<fmt/chrono\.h>'
- '<yaml-cpp/yaml.h>'
- '<asio\.hpp>'
- '<boost/utility/in_place_factory\.hpp>'
- '<libunwind.h>'
Expand Down
1 change: 1 addition & 0 deletions etc/iwyu_mapping.imp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{include: ["\"mongo/platform/compiler_gcc.h\"", "private", "\"mongo/platform/compiler.h\"", "public"]},
{include: ["\"float.h\"", "private", "<cfloat>", "public"]},
{include: ["\"limits.h\"", "private", "<climits>", "public"]},
{include: ["\"stdarg.h\"", "private", "<cstdarg>", "public"]},

{include: ["<boost/smart_ptr/detail/operator_bool.hpp>", "private", "<boost/smart_ptr.hpp>", "public"]},
{include: ["\"boost/smart_ptr/detail/operator_bool.hpp\"", "private", "<boost/smart_ptr.hpp>", "public"]},
Expand Down
1 change: 1 addition & 0 deletions src/mongo/base/data_range_cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "mongo/base/data_range_cursor.h"

#include "mongo/base/error_codes.h"
#include "mongo/util/str.h"

namespace mongo {
Expand Down
3 changes: 2 additions & 1 deletion src/mongo/base/data_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

#include <fmt/format.h>

#include "mongo/util/str.h"
#include "mongo/base/error_codes.h"
#include "mongo/base/string_data.h"

namespace mongo {

Expand Down
5 changes: 3 additions & 2 deletions src/mongo/base/data_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

#pragma once

#include "mongo/config.h"

#include <cstring>
#include <iosfwd>
#include <type_traits>

#include "mongo/base/error_codes.h"
#include "mongo/base/static_assert.h"
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
#include "mongo/config.h" // IWYU pragma: keep

namespace mongo {

Expand Down Expand Up @@ -166,4 +166,5 @@ struct DataType {
// Force the visibility of the DataType::Handler specializations.
#define MONGO_BASE_DATA_TYPE_H_INCLUDE_HANDSHAKE_
#include "mongo/base/data_type_string_data.h"

#undef MONGO_BASE_DATA_TYPE_H_INCLUDE_HANDSHAKE_
7 changes: 6 additions & 1 deletion src/mongo/base/data_type_string_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
* it in the license file.
*/

#include "mongo/base/data_type.h"
#include <cstddef>
#include <cstring>

#include "mongo/base/data_type.h"
#include "mongo/base/error_codes.h"
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
#include "mongo/util/str.h"

namespace mongo {
Expand Down
2 changes: 2 additions & 0 deletions src/mongo/base/data_type_terminated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include "mongo/base/data_type_terminated.h"

#include "mongo/base/error_codes.h"
#include "mongo/base/string_data.h"
#include "mongo/util/str.h"

namespace mongo {
Expand Down
12 changes: 9 additions & 3 deletions src/mongo/base/dependency_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@
#include "mongo/base/dependency_graph.h"

#include <algorithm>
#include <compare>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <iostream>
#include <fmt/ranges.h> // IWYU pragma: keep
#include <iterator>
#include <random>
#include <sstream>
#include <utility>

#include <absl/container/node_hash_map.h>
#include <absl/container/node_hash_set.h>
#include <absl/meta/type_traits.h>

#include "mongo/base/error_codes.h"
#include "mongo/base/string_data.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/string_map.h"

Expand Down
10 changes: 5 additions & 5 deletions src/mongo/base/error_extra_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/base/error_extra_info.h"

#include "mongo/base/init.h"
#include "mongo/db/jsobj.h"
#include "mongo/base/init.h" // IWYU pragma: keep
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/util/assert_util.h"

namespace mongo {

Expand Down
2 changes: 2 additions & 0 deletions src/mongo/base/error_extra_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#pragma once

#include <memory>
#include <string>
#include <type_traits>

// This file is included by many low-level headers including status.h, so it isn't able to include
// much without creating a cycle.
Expand Down
3 changes: 2 additions & 1 deletion src/mongo/base/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
* it in the license file.
*/

#include "mongo/base/init.h"
#include "mongo/base/init.h" // IWYU pragma: keep

#include <cstdlib>
#include <iostream>
#include <utility>

#include "mongo/base/initializer.h"
#include "mongo/util/assert_util.h"
Expand Down
10 changes: 5 additions & 5 deletions src/mongo/base/initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/base/initializer.h"

#include <fmt/format.h>
#include <iostream>
#include <string>
#include <utility>
#include <vector>

#include "mongo/base/dependency_graph.h"
#include "mongo/base/error_codes.h"
#include "mongo/base/initializer.h"
#include "mongo/base/status.h"
#include "mongo/logv2/log.h"
#include "mongo/logv2/log_attr.h"
#include "mongo/logv2/log_component.h"
#include "mongo/logv2/log_truncation.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/exit_code.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/str.h"

#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault

Expand Down
11 changes: 7 additions & 4 deletions src/mongo/base/parse_number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/base/parse_number.h"

#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <limits>
#include <string>

#include <boost/cstdint.hpp>
#include <boost/move/utility_core.hpp>

#include "mongo/base/error_codes.h"
#include "mongo/base/parse_number.h"
#include "mongo/base/static_assert.h"
#include "mongo/base/status_with.h"
#include "mongo/platform/decimal128.h"
#include "mongo/platform/overflow_arithmetic.h"
Expand Down
5 changes: 3 additions & 2 deletions src/mongo/base/shim.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
#include <map>
#include <memory>
#include <string>
#include <utility>

#include "mongo/base/init.h"
#include "mongo/config.h"
#include "mongo/base/init.h" // IWYU pragma: keep
#include "mongo/config.h" // IWYU pragma: keep
#include "mongo/util/assert_util.h"

/**
Expand Down
3 changes: 0 additions & 3 deletions src/mongo/base/simple_string_data_comparator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/base/simple_string_data_comparator.h"

#include "mongo/util/murmur3.h"

namespace mongo {
Expand Down
3 changes: 3 additions & 0 deletions src/mongo/base/simple_string_data_comparator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#pragma once

#include <cstddef>

#include "mongo/base/string_data.h"
#include "mongo/base/string_data_comparator_interface.h"

namespace mongo {
Expand Down
12 changes: 10 additions & 2 deletions src/mongo/base/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@
*/


#include <exception>
#include <ostream>
#include <sstream>

#include <boost/preprocessor/control/iif.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>

#include "mongo/base/status.h"
#include "mongo/db/jsobj.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/builder.h"
#include "mongo/logv2/log.h"
#include "mongo/logv2/log_attr.h"
#include "mongo/logv2/log_component.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/debug_util.h"
#include "mongo/util/str.h"

#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kControl
Expand Down
3 changes: 2 additions & 1 deletion src/mongo/base/string_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

#include "mongo/base/string_data.h"

#include <boost/utility/string_view.hpp>
#include <ostream>

#include <boost/utility/string_view.hpp>
#include <boost/utility/string_view_fwd.hpp>

namespace mongo {

Expand Down
13 changes: 8 additions & 5 deletions src/mongo/base/validate_locale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
* it in the license file.
*/

#include <stdexcept>

#include <boost/filesystem/path.hpp>
#include <codecvt>
#include <locale>
#include <codecvt> // IWYU pragma: keep
#include <locale> // IWYU pragma: keep
#include <stdexcept>
#include <string>

#include "mongo/base/init.h"
#include "mongo/base/error_codes.h"
#include "mongo/base/init.h" // IWYU pragma: keep
#include "mongo/base/initializer.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/str.h"

namespace mongo {
Expand Down
16 changes: 10 additions & 6 deletions src/mongo/bson/bson_comparator_interface_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/bson/bson_comparator_interface_base.h"

#include <boost/functional/hash.hpp>
#include <boost/container_hash/extensions.hpp>
#include <cmath>
#include <limits>

#include "mongo/base/simple_string_data_comparator.h"
#include "mongo/base/string_data_comparator_interface.h"
#include "mongo/bson/bson_comparator_interface_base.h"
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/oid.h"
#include "mongo/bson/timestamp.h"
#include "mongo/platform/decimal128.h"
#include "mongo/util/time_support.h"

namespace mongo {

Expand Down
6 changes: 6 additions & 0 deletions src/mongo/bson/bson_comparator_interface_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@

#pragma once

#include <absl/container/node_hash_map.h>
#include <cstddef>
#include <cstdint>
#include <initializer_list>
#include <iterator>
#include <map>
#include <set>
#include <vector>

#include "mongo/base/error_extra_info.h"
#include "mongo/base/string_data.h"
#include "mongo/base/string_data_comparator_interface.h"
#include "mongo/stdx/unordered_map.h"
#include "mongo/stdx/unordered_set.h"
Expand Down
2 changes: 0 additions & 2 deletions src/mongo/bson/bson_depth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
* it in the license file.
*/

#include "mongo/platform/basic.h"

#include "mongo/bson/bson_depth.h"

namespace mongo {
Expand Down
Loading

0 comments on commit f8e4be7

Please sign in to comment.