Hash :
b8d5a423
Author :
Date :
2023-08-21T14:43:42
Add static_assert(std::is_trivially_copyable<LinkedUniform>(),"") Since we are using memcpy for LinkedUniform, it is desirable to utilize compile time assertion to ensure that in future if anyone modifies POD struct (and the class of data members of POD struct) and made it that no longer memcopy-able, we would immediately caught at compile time. std::is_trivially_copyable<>is exactly for this reason. In order to make this work, the POD struct and any data it uses can not have user defined copy constructor. The problem is that right now ANGLE is using clang_use_chrome_plugins=true, and chrome-style generates warnings if the complex struct (has more than 10 data members) does not define a copy constructor, and that warning causes build failure with -Werror. So clang_use_chrome_plugins=true and std::is_trivially_copyable have this conflicting requirements that I can not apply both. This has been raised to compiler team, but before we get a solution from them, if we have to make a choice, I think the better choice is to disable clang_use_chrome_plugins and apply std::is_trivially_copyable, since the later is more critical to ensure safety, while chrome-style is mostly trying to minimize the code size, but won't affect correctness/robustness. This CL sets clang_use_chrome_plugins to false, and removes the copy constructor and copy assignment operator from BitSetT and LinkedUniform and added static assertion is_trivially_copyable for LinkedUniform. Same thing applied to ProgramInput as well. In future once we have a better solution from compile team, we can re-enable clang_use_chrome_plugins and disable only for structs that requires is_trivially_copyable assertion. Bug: b/275102061 Change-Id: If33415ea61deda568d855a7dd6a4fd6042058be5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4799342 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This file is used when gn runs in this directory (or a lower directory
# and searching upward ends here). See "gn help dotfile."
# As a result this file will only affect stand-alone ANGLE builds,
# not chromium builds.
import("//build/dotfile_settings.gni")
import("//dotfile_settings.gni")
# Location of the build configuration file.
buildconfig = "//build/config/BUILDCONFIG.gn"
# The python interpreter to use by default. On Windows, this will look
# for python3.exe and python3.bat.
script_executable = "python3"
# These are the targets to check headers for by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will have
# their includes checked for proper dependencies when you run either
# "gn check" or "gn gen --check".
check_targets = [ "*" ]
# These are the list of GN files that run exec_script. This allowlist exists
# to force additional review for new uses of exec_script, which is strongly
# discouraged except for gypi_to_gn calls.
exec_script_whitelist = angle_dotfile_settings.exec_script_whitelist +
build_dotfile_settings.exec_script_whitelist +
[
"//build/config/sysroot.gni",
"//build/config/win/BUILD.gn",
"//build/config/win/visual_studio_version.gni",
"//build/gn_helpers.py",
"//build_overrides/build.gni",
]
default_args = {
clang_use_chrome_plugins = false
build_angle_deqp_tests = true
use_sysroot = true
# Saves on importing extra dependencies and ANGLE doesn't use JS.
enable_js_protobuf = false
# Saves on importing extra dependencies and ANGLE doesn't use Rust.
enable_rust = false
# Disable location tags in isolates.
tests_have_location_tags = false
# Use base level API level 29 support for AHardwareBuffer ANGLE tests.
android32_ndk_api_level = 29
android64_ndk_api_level = 29
}