Skip to content

Commit e9b9e38

Browse files
Abseil Teamvslashg
Abseil Team
authored andcommitted
Export of internal Abseil changes
-- 0e3e8be75b3ab243991c9b28a27623d86e4511e6 by Abseil Team <[email protected]>: Add constructor overloads with signature (Mutex*, const Condition&) to MutexLock, ReaderMutexLock, WriterMutexLock, ReleasableMutexLock, MaybeMutexLock. These overloads call Mutex::LockWhen, Mutex::ReaderLockWhen, Mutex::WriterLockWhen. Using the guard classes with these new constructors replaces both manual LockWhen/Unlock sequences and the less-efficient, but popular current pattern of "absl::MutexLock lock(&mu); mu.Await(cond);". PiperOrigin-RevId: 339480213 -- ff999bc08360f5bd95557147c97b0e7b200fe3a8 by Jorg Brown <[email protected]>: ConvertibleToStringView wastes a lot of cycles initializing members just to reset them immediately after. Only initialize the string storage when needed. This makes StrSplit() 0-30% faster depending on the use case. PiperOrigin-RevId: 339479046 -- 0a773bfb8bc141433a41388731357001fdb34881 by Derek Mauro <[email protected]>: Remove the compiler upgrade fiasco inducing -Weverything -Werror. Switch to a curated set of warnings that may be expanded in the future. PiperOrigin-RevId: 339472677 -- eab54e3e11b126283d33f64c914b200038d215a4 by Abseil Team <[email protected]>: Change execute permission to match presence of the shebang remove execute permission for cmake_common.sh add execute permission for conanfile.py PiperOrigin-RevId: 339453550 -- 7f9726fb605ed20f17f3e221dbce0df03d6904c6 by Abseil Team <[email protected]>: Internal change PiperOrigin-RevId: 339385761 -- f3210dbee3e8a719cf31706963721722203f90e0 by Derek Mauro <[email protected]>: Switch clang compiler detection to use to the Bazel supported mechanism When Abseil launched, we relied on the compiler string "llvm", which we manually set when we used the automatic crosstool generation by using the environment variable BAZEL_COMPILER. Today, Bazel detects clang and automatically sets the compiler string to "clang". Fixes abseil#732 PiperOrigin-RevId: 339360688 -- 413211f59e5e671bf5774efa63ab4df185c74248 by Abseil Team <[email protected]>: Minor comment clarifications and cosmetic tweaks. PiperOrigin-RevId: 339344301 GitOrigin-RevId: 0e3e8be75b3ab243991c9b28a27623d86e4511e6 Change-Id: Ia5b7224cd3d274c79ec7f5514fef63014f458f0f
1 parent 962b067 commit e9b9e38

17 files changed

+244
-326
lines changed

CMake/AbseilHelpers.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function(absl_cc_library)
160160
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
161161
endif()
162162
endforeach()
163-
FILE(GENERATE OUTPUT "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
163+
FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
164164
prefix=${CMAKE_INSTALL_PREFIX}\n\
165165
exec_prefix=\${prefix}\n\
166166
libdir=\${prefix}/lib\n\
@@ -173,6 +173,8 @@ Version: ${PC_VERSION}\n\
173173
Requires.private:${PC_DEPS}\n\
174174
Libs: -L\${libdir} $<JOIN:${ABSL_CC_LIB_LINKOPTS}, > $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
175175
Cflags: -I\${includedir}${PC_CFLAGS}\n")
176+
INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc"
177+
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
176178
endif()
177179
endif()
178180

absl/BUILD.bazel

+5-8
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
16-
17-
load(
18-
":compiler_config_setting.bzl",
19-
"create_llvm_config",
20-
)
2115

2216
package(default_visibility = ["//visibility:public"])
2317

2418
licenses(["notice"])
2519

26-
create_llvm_config(
27-
name = "llvm_compiler",
20+
config_setting(
21+
name = "clang_compiler",
22+
flag_values = {
23+
"@bazel_tools//tools/cpp:compiler": "clang",
24+
},
2825
visibility = [":__subpackages__"],
2926
)
3027

absl/compiler_config_setting.bzl

-38
This file was deleted.

absl/copts/GENERATED_AbseilCopts.cmake

+28-79
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,6 @@
55

66
list(APPEND ABSL_CLANG_CL_FLAGS
77
"/W3"
8-
"-Wno-c++98-compat-pedantic"
9-
"-Wno-conversion"
10-
"-Wno-covered-switch-default"
11-
"-Wno-deprecated"
12-
"-Wno-disabled-macro-expansion"
13-
"-Wno-double-promotion"
14-
"-Wno-comma"
15-
"-Wno-extra-semi"
16-
"-Wno-extra-semi-stmt"
17-
"-Wno-packed"
18-
"-Wno-padded"
19-
"-Wno-float-conversion"
20-
"-Wno-float-equal"
21-
"-Wno-format-nonliteral"
22-
"-Wno-gcc-compat"
23-
"-Wno-global-constructors"
24-
"-Wno-exit-time-destructors"
25-
"-Wno-non-modular-include-in-module"
26-
"-Wno-old-style-cast"
27-
"-Wno-range-loop-analysis"
28-
"-Wno-reserved-id-macro"
29-
"-Wno-shorten-64-to-32"
30-
"-Wno-switch-enum"
31-
"-Wno-thread-safety-negative"
32-
"-Wno-unknown-warning-option"
33-
"-Wno-unreachable-code"
34-
"-Wno-unused-macros"
35-
"-Wno-weak-vtables"
36-
"-Wno-zero-as-null-pointer-constant"
37-
"-Wbitfield-enum-conversion"
38-
"-Wbool-conversion"
39-
"-Wconstant-conversion"
40-
"-Wenum-conversion"
41-
"-Wint-conversion"
42-
"-Wliteral-conversion"
43-
"-Wnon-literal-null-conversion"
44-
"-Wnull-conversion"
45-
"-Wobjc-literal-conversion"
46-
"-Wno-sign-conversion"
47-
"-Wstring-conversion"
488
"/DNOMINMAX"
499
"/DWIN32_LEAN_AND_MEAN"
5010
"/D_CRT_SECURE_NO_WARNINGS"
@@ -77,6 +37,7 @@ list(APPEND ABSL_GCC_FLAGS
7737
"-Wextra"
7838
"-Wcast-qual"
7939
"-Wconversion-null"
40+
"-Wformat-security"
8041
"-Wmissing-declarations"
8142
"-Woverlength-strings"
8243
"-Wpointer-arith"
@@ -86,7 +47,6 @@ list(APPEND ABSL_GCC_FLAGS
8647
"-Wvarargs"
8748
"-Wvla"
8849
"-Wwrite-strings"
89-
"-Wno-missing-field-initializers"
9050
"-DNOMINMAX"
9151
)
9252

@@ -103,47 +63,36 @@ list(APPEND ABSL_GCC_TEST_FLAGS
10363
list(APPEND ABSL_LLVM_FLAGS
10464
"-Wall"
10565
"-Wextra"
106-
"-Weverything"
107-
"-Wno-c++98-compat-pedantic"
108-
"-Wno-conversion"
109-
"-Wno-covered-switch-default"
110-
"-Wno-deprecated"
111-
"-Wno-disabled-macro-expansion"
112-
"-Wno-double-promotion"
113-
"-Wno-comma"
114-
"-Wno-extra-semi"
115-
"-Wno-extra-semi-stmt"
116-
"-Wno-packed"
117-
"-Wno-padded"
66+
"-Wcast-qual"
67+
"-Wconversion"
68+
"-Wfloat-overflow-conversion"
69+
"-Wfloat-zero-conversion"
70+
"-Wfor-loop-analysis"
71+
"-Wformat-security"
72+
"-Wgnu-redeclared-enum"
73+
"-Winfinite-recursion"
74+
"-Wliteral-conversion"
75+
"-Wmissing-declarations"
76+
"-Woverlength-strings"
77+
"-Wpointer-arith"
78+
"-Wself-assign"
79+
"-Wshadow"
80+
"-Wstring-conversion"
81+
"-Wtautological-overlap-compare"
82+
"-Wundef"
83+
"-Wuninitialized"
84+
"-Wunreachable-code"
85+
"-Wunused-comparison"
86+
"-Wunused-local-typedefs"
87+
"-Wunused-result"
88+
"-Wvla"
89+
"-Wwrite-strings"
11890
"-Wno-float-conversion"
119-
"-Wno-float-equal"
120-
"-Wno-format-nonliteral"
121-
"-Wno-gcc-compat"
122-
"-Wno-global-constructors"
123-
"-Wno-exit-time-destructors"
124-
"-Wno-non-modular-include-in-module"
125-
"-Wno-old-style-cast"
126-
"-Wno-range-loop-analysis"
127-
"-Wno-reserved-id-macro"
91+
"-Wno-implicit-float-conversion"
92+
"-Wno-implicit-int-float-conversion"
93+
"-Wno-implicit-int-conversion"
12894
"-Wno-shorten-64-to-32"
129-
"-Wno-switch-enum"
130-
"-Wno-thread-safety-negative"
131-
"-Wno-unknown-warning-option"
132-
"-Wno-unreachable-code"
133-
"-Wno-unused-macros"
134-
"-Wno-weak-vtables"
135-
"-Wno-zero-as-null-pointer-constant"
136-
"-Wbitfield-enum-conversion"
137-
"-Wbool-conversion"
138-
"-Wconstant-conversion"
139-
"-Wenum-conversion"
140-
"-Wint-conversion"
141-
"-Wliteral-conversion"
142-
"-Wnon-literal-null-conversion"
143-
"-Wnull-conversion"
144-
"-Wobjc-literal-conversion"
14595
"-Wno-sign-conversion"
146-
"-Wstring-conversion"
14796
"-DNOMINMAX"
14897
)
14998

absl/copts/GENERATED_copts.bzl

+28-79
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,6 @@
66

77
ABSL_CLANG_CL_FLAGS = [
88
"/W3",
9-
"-Wno-c++98-compat-pedantic",
10-
"-Wno-conversion",
11-
"-Wno-covered-switch-default",
12-
"-Wno-deprecated",
13-
"-Wno-disabled-macro-expansion",
14-
"-Wno-double-promotion",
15-
"-Wno-comma",
16-
"-Wno-extra-semi",
17-
"-Wno-extra-semi-stmt",
18-
"-Wno-packed",
19-
"-Wno-padded",
20-
"-Wno-float-conversion",
21-
"-Wno-float-equal",
22-
"-Wno-format-nonliteral",
23-
"-Wno-gcc-compat",
24-
"-Wno-global-constructors",
25-
"-Wno-exit-time-destructors",
26-
"-Wno-non-modular-include-in-module",
27-
"-Wno-old-style-cast",
28-
"-Wno-range-loop-analysis",
29-
"-Wno-reserved-id-macro",
30-
"-Wno-shorten-64-to-32",
31-
"-Wno-switch-enum",
32-
"-Wno-thread-safety-negative",
33-
"-Wno-unknown-warning-option",
34-
"-Wno-unreachable-code",
35-
"-Wno-unused-macros",
36-
"-Wno-weak-vtables",
37-
"-Wno-zero-as-null-pointer-constant",
38-
"-Wbitfield-enum-conversion",
39-
"-Wbool-conversion",
40-
"-Wconstant-conversion",
41-
"-Wenum-conversion",
42-
"-Wint-conversion",
43-
"-Wliteral-conversion",
44-
"-Wnon-literal-null-conversion",
45-
"-Wnull-conversion",
46-
"-Wobjc-literal-conversion",
47-
"-Wno-sign-conversion",
48-
"-Wstring-conversion",
499
"/DNOMINMAX",
5010
"/DWIN32_LEAN_AND_MEAN",
5111
"/D_CRT_SECURE_NO_WARNINGS",
@@ -78,6 +38,7 @@ ABSL_GCC_FLAGS = [
7838
"-Wextra",
7939
"-Wcast-qual",
8040
"-Wconversion-null",
41+
"-Wformat-security",
8142
"-Wmissing-declarations",
8243
"-Woverlength-strings",
8344
"-Wpointer-arith",
@@ -87,7 +48,6 @@ ABSL_GCC_FLAGS = [
8748
"-Wvarargs",
8849
"-Wvla",
8950
"-Wwrite-strings",
90-
"-Wno-missing-field-initializers",
9151
"-DNOMINMAX",
9252
]
9353

@@ -104,47 +64,36 @@ ABSL_GCC_TEST_FLAGS = [
10464
ABSL_LLVM_FLAGS = [
10565
"-Wall",
10666
"-Wextra",
107-
"-Weverything",
108-
"-Wno-c++98-compat-pedantic",
109-
"-Wno-conversion",
110-
"-Wno-covered-switch-default",
111-
"-Wno-deprecated",
112-
"-Wno-disabled-macro-expansion",
113-
"-Wno-double-promotion",
114-
"-Wno-comma",
115-
"-Wno-extra-semi",
116-
"-Wno-extra-semi-stmt",
117-
"-Wno-packed",
118-
"-Wno-padded",
67+
"-Wcast-qual",
68+
"-Wconversion",
69+
"-Wfloat-overflow-conversion",
70+
"-Wfloat-zero-conversion",
71+
"-Wfor-loop-analysis",
72+
"-Wformat-security",
73+
"-Wgnu-redeclared-enum",
74+
"-Winfinite-recursion",
75+
"-Wliteral-conversion",
76+
"-Wmissing-declarations",
77+
"-Woverlength-strings",
78+
"-Wpointer-arith",
79+
"-Wself-assign",
80+
"-Wshadow",
81+
"-Wstring-conversion",
82+
"-Wtautological-overlap-compare",
83+
"-Wundef",
84+
"-Wuninitialized",
85+
"-Wunreachable-code",
86+
"-Wunused-comparison",
87+
"-Wunused-local-typedefs",
88+
"-Wunused-result",
89+
"-Wvla",
90+
"-Wwrite-strings",
11991
"-Wno-float-conversion",
120-
"-Wno-float-equal",
121-
"-Wno-format-nonliteral",
122-
"-Wno-gcc-compat",
123-
"-Wno-global-constructors",
124-
"-Wno-exit-time-destructors",
125-
"-Wno-non-modular-include-in-module",
126-
"-Wno-old-style-cast",
127-
"-Wno-range-loop-analysis",
128-
"-Wno-reserved-id-macro",
92+
"-Wno-implicit-float-conversion",
93+
"-Wno-implicit-int-float-conversion",
94+
"-Wno-implicit-int-conversion",
12995
"-Wno-shorten-64-to-32",
130-
"-Wno-switch-enum",
131-
"-Wno-thread-safety-negative",
132-
"-Wno-unknown-warning-option",
133-
"-Wno-unreachable-code",
134-
"-Wno-unused-macros",
135-
"-Wno-weak-vtables",
136-
"-Wno-zero-as-null-pointer-constant",
137-
"-Wbitfield-enum-conversion",
138-
"-Wbool-conversion",
139-
"-Wconstant-conversion",
140-
"-Wenum-conversion",
141-
"-Wint-conversion",
142-
"-Wliteral-conversion",
143-
"-Wnon-literal-null-conversion",
144-
"-Wnull-conversion",
145-
"-Wobjc-literal-conversion",
14696
"-Wno-sign-conversion",
147-
"-Wstring-conversion",
14897
"-DNOMINMAX",
14998
]
15099

absl/copts/configure_copts.bzl

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ load(
2323

2424
ABSL_DEFAULT_COPTS = select({
2525
"//absl:windows": ABSL_MSVC_FLAGS,
26-
"//absl:llvm_compiler": ABSL_LLVM_FLAGS,
26+
"//absl:clang_compiler": ABSL_LLVM_FLAGS,
2727
"//conditions:default": ABSL_GCC_FLAGS,
2828
})
2929

30-
# in absence of modules (--compiler=gcc or -c opt), cc_tests leak their copts
31-
# to their (included header) dependencies and fail to build outside absl
3230
ABSL_TEST_COPTS = ABSL_DEFAULT_COPTS + select({
3331
"//absl:windows": ABSL_MSVC_TEST_FLAGS,
34-
"//absl:llvm_compiler": ABSL_LLVM_TEST_FLAGS,
32+
"//absl:clang_compiler": ABSL_LLVM_TEST_FLAGS,
3533
"//conditions:default": ABSL_GCC_TEST_FLAGS,
3634
})
3735

0 commit comments

Comments
 (0)