www.fgks.org   »   [go: up one dir, main page]

Skip to content

Commit

Permalink
Revert "Enable -Wshadow by default for the "chromium code" config."
Browse files Browse the repository at this point in the history
This reverts commit 4bc6f71.

Reason for revert: [Sheriff] most likely to have caused tree failure just now

Original change's description:
> Enable -Wshadow by default for the "chromium code" config.
>
> Bug: 794619
> Change-Id: Ic125a2da8692ba63479d260d3712ed75d7a7cd9f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202306
> Auto-Submit: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Owners-Override: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#940761}

TBR=sky@chromium.org,pkasting@chromium.org,dpranke@google.com,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I507152afeadaf7c8d66822a30e9d94858aaecb91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 794619
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3275779
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Owners-Override: Liviu Tinta <liviutinta@chromium.org>
Owners-Override: Kamila Hasanbega <hkamila@google.com>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940767}
  • Loading branch information
Kamila Hasanbega authored and Chromium LUCI CQ committed Nov 11, 2021
1 parent 13c3608 commit 3fadf6d
Show file tree
Hide file tree
Showing 28 changed files with 89 additions and 29 deletions.
6 changes: 5 additions & 1 deletion base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ component("base") {
":base_implementation",
":memory_tagging",
"//build/config:precompiled_headers",
"//build/config/compiler:noshadowing",
"//build/config/compiler:wglobal_constructors",
]

Expand Down Expand Up @@ -3736,7 +3737,10 @@ test("base_unittests") {
]
}

configs += [ ":memory_tagging" ]
configs += [
":memory_tagging",
"//build/config/compiler:noshadowing",
]
}

action("build_date") {
Expand Down
5 changes: 1 addition & 4 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1649,10 +1649,7 @@ config("chromium_code") {
}
}

configs = [
":default_warnings",
":noshadowing",
]
configs = [ ":default_warnings" ]
}

config("no_chromium_code") {
Expand Down
1 change: 1 addition & 0 deletions cc/cc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import("//testing/test.gni")
cc_remove_configs = []
cc_add_configs = [
"//build/config:precompiled_headers",
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]

Expand Down
4 changes: 4 additions & 0 deletions components/android_system_error_page/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ static_library("android_system_error_page") {
"error_page_populator.h",
]

configs += [
"//build/config/compiler:noshadowing",
]

deps = [
"//base",
"//base:i18n",
Expand Down
8 changes: 0 additions & 8 deletions components/exo/wayland/compatibility_test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ wayland_protocol_codegen("generated_client_event_receiver_version_tests") {
"$target_gen_dir/all_generated_client_event_receiver_version_tests.cc"
}

config("generated_code_warnings") {
if (is_clang) {
cflags = [ "-Wno-shadow" ]
}
}

source_set("compatibility_test") {
testonly = true

Expand Down Expand Up @@ -105,6 +99,4 @@ source_set("compatibility_test") {
"//third_party/wayland-protocols:vsync_feedback_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
]

configs += [ ":generated_code_warnings" ]
}
2 changes: 2 additions & 0 deletions components/url_formatter/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ static_library("url_formatter") {
"url_formatter.h",
]

configs += [ "//build/config/compiler:noshadowing" ]

deps = [
"//base",
"//base:i18n",
Expand Down
5 changes: 4 additions & 1 deletion content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import("//tools/grit/grit_rule.gni")
# Applied by targets internal to content.
config("content_implementation") {
defines = [ "CONTENT_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

assert(!is_ios, "Chromium/iOS shouldn't use anything in //content")
Expand Down
25 changes: 20 additions & 5 deletions gpu/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,42 @@ import("//ui/gl/features.gni")

config("gpu_implementation") {
defines = [ "GPU_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

config("gpu_gles2_implementation") {
defines = [ "GPU_GLES2_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

config("gpu_util_implementation") {
defines = [ "GPU_UTIL_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

config("raster_implementation") {
defines = [ "RASTER_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

config("webgpu_implementation") {
defines = [ "WEBGPU_IMPLEMENTATION" ]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]
}

component("gpu") {
Expand Down
1 change: 1 addition & 0 deletions mojo/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ template("core_impl_source_set") {
defines += [ "MOJO_CORE_LEGACY_PROTOCOL" ]
}

configs += [ "//build/config/compiler:noshadowing" ]
if (!is_debug && !optimize_for_size) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
Expand Down
2 changes: 0 additions & 2 deletions net/third_party/quiche/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ config("quiche_config") {
"src/common/platform/default",
"src",
]

cflags = [ "-Wno-shadow" ]
}

# Since //net and //net/third_party/quiche have a circular dependency on each
Expand Down
15 changes: 14 additions & 1 deletion pdf/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ buildflag_header("buildflags") {
}

if (enable_pdf) {
config("common") {
configs = [ "//build/config/compiler:noshadowing" ]
}

config("strict") {
configs = [ "//build/config/compiler:wexit_time_destructors" ]
configs = [
":common",
"//build/config/compiler:wexit_time_destructors",
]
}

config("pdfium_includes") {
Expand Down Expand Up @@ -218,6 +225,8 @@ if (enable_pdf) {
"ppapi_migration/ppapi_assert_matching_enums.cc",
]

configs += [ ":common" ]

deps = [
":accessibility",
":internal",
Expand Down Expand Up @@ -395,6 +404,8 @@ if (enable_pdf) {
"test/test_pdfium_engine.h",
]

configs += [ ":common" ]

deps = [
":internal",
":ppapi_migration",
Expand Down Expand Up @@ -457,6 +468,8 @@ if (enable_pdf) {
"ui/thumbnail_unittest.cc",
]

configs += [ ":common" ]

data = [ "test/data/" ]

deps = [
Expand Down
5 changes: 5 additions & 0 deletions printing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ component("printing_base") {
public_configs = [ ":cups" ]
}

configs += [ "//build/config/compiler:noshadowing" ]
cflags = []
defines = [ "IS_PRINTING_BASE_IMPL" ]

Expand Down Expand Up @@ -106,6 +107,7 @@ component("metafile") {
"metafile_skia.h",
]

configs += [ "//build/config/compiler:noshadowing" ]
defines = [ "IS_PRINTING_METAFILE_IMPL" ]
public_deps = [
":native_drawing_context",
Expand Down Expand Up @@ -161,6 +163,7 @@ component("printing") {
"pwg_raster_settings.h",
]

configs += [ "//build/config/compiler:noshadowing" ]
cflags = []
defines = [ "IS_PRINTING_IMPL" ]

Expand Down Expand Up @@ -274,6 +277,7 @@ static_library("test_support") {
"test_printing_context.h",
]

configs += [ "//build/config/compiler:noshadowing" ]
public_deps = [
"//printing",
"//printing/backend:test_support",
Expand Down Expand Up @@ -318,6 +322,7 @@ test("printing_unittests") {
"units_unittest.cc",
]

configs += [ "//build/config/compiler:noshadowing" ]
deps = [
":printing",
":test_support",
Expand Down
2 changes: 2 additions & 0 deletions printing/backend/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ component("backend") {
]

public_configs = []
configs += [ "//build/config/compiler:noshadowing" ]
cflags = []
defines = [ "IS_PRINT_BACKEND_IMPL" ]

Expand Down Expand Up @@ -150,6 +151,7 @@ source_set("test_support") {
"test_print_backend.h",
]

configs += [ "//build/config/compiler:noshadowing" ]
deps = [
":backend",
"//base",
Expand Down
5 changes: 4 additions & 1 deletion third_party/blink/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ source_set("common") {
"//third_party/blink/public/common",
]

configs += [ ":blink_common_implementation" ]
configs += [
":blink_common_implementation",
"//build/config/compiler:noshadowing",
]

sources = [
# NOTE: Please do not add public headers that need to be referenced from
Expand Down
4 changes: 4 additions & 0 deletions third_party/blink/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ config("inside_blink") {
"-Wno-implicit-int-conversion",
]
}

configs = [ "//build/config/compiler:noshadowing" ]
}

# blink_pch --------------------------------------------------------------------
Expand Down Expand Up @@ -134,4 +136,6 @@ config("non_test_config") {
if (is_clang) {
cflags += [ "-Wglobal-constructors" ]
}

configs = [ "//build/config/compiler:noshadowing" ]
}
1 change: 1 addition & 0 deletions third_party/blink/renderer/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ component("controller") {
}

configs += [
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
Expand Down
5 changes: 4 additions & 1 deletion third_party/blink/renderer/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ config("blink_core_pch") {
}
}

core_config_add += [ ":blink_core_pch" ]
core_config_add += [
":blink_core_pch",
"//build/config/compiler:noshadowing",
]

source_set("core_common") {
sources = [ "core_export.h" ]
Expand Down
2 changes: 2 additions & 0 deletions third_party/blink/renderer/core/animation/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ buildflag_header("buildflags") {
}

blink_core_sources("animation") {
configs += [ "//build/config/compiler:noshadowing" ]

sources = [
"animatable.cc",
"animatable.h",
Expand Down
2 changes: 2 additions & 0 deletions third_party/blink/renderer/core/exported/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ static_library("test_support") {
}

blink_core_sources("exported") {
configs += [ "//build/config/compiler:noshadowing" ]

sources = [
"web_array_buffer.cc",
"web_array_buffer_converter.cc",
Expand Down
2 changes: 2 additions & 0 deletions third_party/blink/renderer/core/probe/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ source_set("generated") {

# Compiles the sources generated above.
blink_core_sources("probe") {
configs += [ "//build/config/compiler:noshadowing" ]

sources = [
"async_task_id.h",
"core_probes.cc",
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ config("blink_platform_config") {
configs = [
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
"//build/config/compiler:noshadowing",
]
}

Expand Down
2 changes: 2 additions & 0 deletions third_party/blink/renderer/platform/wtf/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ config("wtf_config") {
}

component("wtf") {
configs += [ "//build/config/compiler:noshadowing" ]

sources = [
"allocator/allocator.cc",
"allocator/allocator.h",
Expand Down
2 changes: 0 additions & 2 deletions third_party/nearby/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ source_set("platform_impl_shared_file") {
":platform_public_types",
"//third_party/abseil-cpp:absl",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}

# src/cpp/platform/public
Expand Down
2 changes: 2 additions & 0 deletions ui/aura/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ component("aura") {
public += [ "screen_ozone.h" ]
sources += [ "screen_ozone.cc" ]
}

configs += [ "//build/config/compiler:noshadowing" ]
}

static_library("test_support") {
Expand Down
1 change: 1 addition & 0 deletions ui/gfx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ component("gfx") {

configs += [
"//build/config:precompiled_headers",
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]

Expand Down
1 change: 1 addition & 0 deletions ui/gfx/animation/keyframe/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import("//build/config/ui.gni")
keyframe_animation_remove_configs = []
keyframe_animation_add_configs = [
"//build/config:precompiled_headers",
"//build/config/compiler:noshadowing",
"//build/config/compiler:wexit_time_destructors",
]

Expand Down
2 changes: 0 additions & 2 deletions ui/gfx/x/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ config("x11_private_config") {

config("build_xprotos_config") {
cflags = [
"-Wno-shadow",

# Generated proto files pull all fields from a struct into scope
# even if they aren't used. Rather than adding logic in the
# generator to determine which fields are used and keeping only
Expand Down
Loading

0 comments on commit 3fadf6d

Please sign in to comment.