Skip to content

Commit 111ca70

Browse files
Abseil Teammbxx
Abseil Team
authored andcommitted
Export of internal Abseil changes.
-- a2adbf75201f6b7feba929f77dfc4f87f9c1110b by Abseil Team <[email protected]>: This change allows for capturing the address of the mutex from which a call to `Block(...)` could be introducing latency. The attribute is a no-op if the application is not being built with XRay instrumentation. See http://llvm.org/docs/XRay.html for more information about XRay. PiperOrigin-RevId: 225752598 -- 6bc7f25573ddc6711f484dfacab9459f45e0bf42 by Abseil Team <[email protected]>: Update absl/utility/CMakeLists.txt to use new functions i.e. absl_cc_(library|test) PiperOrigin-RevId: 225651883 -- 4acde5e72032f31a26a1ffa53a28f35dbb0bd7d3 by Abseil Team <[email protected]>: Update absl/types/CMakeLists.txt to use new functions i.e. absl_cc_(library|test) PiperOrigin-RevId: 225584788 -- fe2c740d64b17cece25eee4e5d2196a7c059d3e9 by Abseil Team <[email protected]>: Update auto-generated build options files. PiperOrigin-RevId: 225557283 -- cd779dddceeee191ee82deb6b9030c4db288e758 by Jon Cohen <[email protected]>: Internal change. PiperOrigin-RevId: 225556657 -- 3d56dd132d845930c3fb520a39ee77ecb2430bd2 by Matt Kulukundis <[email protected]>: Internal cleanup PiperOrigin-RevId: 225488946 GitOrigin-RevId: a2adbf75201f6b7feba929f77dfc4f87f9c1110b Change-Id: I1b2178e053bdebc8cf3dcb017b0e247619b81a0c
1 parent 389ec3f commit 111ca70

13 files changed

+373
-250
lines changed

CMake/AbseilHelpers.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ function(absl_cc_library)
135135
endif()
136136

137137
# Check if this is a header-only library
138-
if ("${ABSL_CC_LIB_SRCS}" STREQUAL "")
138+
set(ABSL_CC_SRCS "${ABSL_CC_LIB_SRCS}")
139+
list(FILTER ABSL_CC_SRCS EXCLUDE REGEX ".*\\.h")
140+
if ("${ABSL_CC_SRCS}" STREQUAL "")
139141
set(ABSL_CC_LIB_IS_INTERFACE 1)
140142
else()
141143
set(ABSL_CC_LIB_IS_INTERFACE 0)

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ include(AbseilHelpers)
4848
# include current path
4949
list(APPEND ABSL_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
5050

51-
# -fexceptions
52-
set(ABSL_EXCEPTIONS_FLAG "${CMAKE_CXX_EXCEPTIONS}")
53-
5451
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
5552
set(ABSL_USING_CLANG ON)
5653
else()

absl/base/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ absl_cc_library(
181181
SRCS
182182
"internal/exception_safety_testing.cc"
183183
COPTS
184-
${ABSL_DEFAULT_COPTS}
184+
${ABSL_TEST_COPTS}
185185
${ABSL_EXCEPTIONS_FLAG}
186+
LINKOPTS
187+
${ABSL_EXCEPTIONS_FLAG_LINKOPTS}
186188
DEPS
187-
absl::base
188189
absl::config
189190
absl::pretty_function
190191
absl::memory
@@ -201,6 +202,7 @@ absl_cc_test(
201202
SRCS
202203
"exception_safety_testing_test.cc"
203204
COPTS
205+
${ABSL_TEST_COPTS}
204206
${ABSL_EXCEPTIONS_FLAG}
205207
LINKOPTS
206208
${ABSL_EXCEPTIONS_FLAG_LINKOPTS}

absl/container/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
load(
1818
"//absl:copts/configure_copts.bzl",
1919
"ABSL_DEFAULT_COPTS",
20-
"ABSL_TEST_COPTS",
2120
"ABSL_EXCEPTIONS_FLAG",
2221
"ABSL_EXCEPTIONS_FLAG_LINKOPTS",
22+
"ABSL_TEST_COPTS",
2323
)
2424

2525
package(default_visibility = ["//visibility:public"])
@@ -463,6 +463,12 @@ cc_library(
463463
],
464464
)
465465

466+
cc_library(
467+
name = "have_sse",
468+
hdrs = ["internal/have_sse.h"],
469+
copts = ABSL_DEFAULT_COPTS,
470+
)
471+
466472
cc_library(
467473
name = "raw_hash_set",
468474
srcs = ["internal/raw_hash_set.cc"],
@@ -473,6 +479,7 @@ cc_library(
473479
":container_memory",
474480
":hash_policy_traits",
475481
":hashtable_debug_hooks",
482+
":have_sse",
476483
":layout",
477484
"//absl/base:bits",
478485
"//absl/base:config",

absl/container/CMakeLists.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,16 @@ absl_cc_library(
452452
PUBLIC
453453
)
454454

455+
absl_cc_library(
456+
NAME
457+
have_sse
458+
HDRS
459+
"internal/have_sse.h"
460+
COPTS
461+
${ABSL_DEFAULT_COPTS}
462+
PUBLIC
463+
)
464+
455465
absl_cc_library(
456466
NAME
457467
node_hash_policy
@@ -496,15 +506,16 @@ absl_cc_library(
496506
COPTS
497507
${ABSL_DEFAULT_COPTS}
498508
DEPS
509+
absl::bits
499510
absl::compressed_tuple
511+
absl::config
500512
absl::container_memory
513+
absl::core_headers
514+
absl::endian
501515
absl::hash_policy_traits
502516
absl::hashtable_debug_hooks
517+
absl::have_sse
503518
absl::layout
504-
absl::bits
505-
absl::config
506-
absl::core_headers
507-
absl::endian
508519
absl::memory
509520
absl::meta
510521
absl::optional

absl/container/internal/have_sse.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2018 The Abseil Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// Shared config probing for SSE instructions used in Swiss tables.
16+
#ifndef ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_
17+
#define ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_
18+
19+
#ifndef SWISSTABLE_HAVE_SSE2
20+
#if defined(__SSE2__) || \
21+
(defined(_MSC_VER) && \
22+
(defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2)))
23+
#define SWISSTABLE_HAVE_SSE2 1
24+
#else
25+
#define SWISSTABLE_HAVE_SSE2 0
26+
#endif
27+
#endif
28+
29+
#ifndef SWISSTABLE_HAVE_SSSE3
30+
#ifdef __SSSE3__
31+
#define SWISSTABLE_HAVE_SSSE3 1
32+
#else
33+
#define SWISSTABLE_HAVE_SSSE3 0
34+
#endif
35+
#endif
36+
37+
#if SWISSTABLE_HAVE_SSSE3 && !SWISSTABLE_HAVE_SSE2
38+
#error "Bad configuration!"
39+
#endif
40+
41+
#if SWISSTABLE_HAVE_SSE2
42+
#include <emmintrin.h>
43+
#endif
44+
45+
#if SWISSTABLE_HAVE_SSSE3
46+
#include <tmmintrin.h>
47+
#endif
48+
49+
#endif // ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_

absl/container/internal/raw_hash_set.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,6 @@
9191
#ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
9292
#define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
9393

94-
#ifndef SWISSTABLE_HAVE_SSE2
95-
#if defined(__SSE2__) || \
96-
(defined(_MSC_VER) && \
97-
(defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2)))
98-
#define SWISSTABLE_HAVE_SSE2 1
99-
#else
100-
#define SWISSTABLE_HAVE_SSE2 0
101-
#endif
102-
#endif
103-
104-
#ifndef SWISSTABLE_HAVE_SSSE3
105-
#ifdef __SSSE3__
106-
#define SWISSTABLE_HAVE_SSSE3 1
107-
#else
108-
#define SWISSTABLE_HAVE_SSSE3 0
109-
#endif
110-
#endif
111-
112-
#if SWISSTABLE_HAVE_SSSE3 && !SWISSTABLE_HAVE_SSE2
113-
#error "Bad configuration!"
114-
#endif
115-
116-
#if SWISSTABLE_HAVE_SSE2
117-
#include <emmintrin.h>
118-
#endif
119-
120-
#if SWISSTABLE_HAVE_SSSE3
121-
#include <tmmintrin.h>
122-
#endif
123-
12494
#include <algorithm>
12595
#include <cmath>
12696
#include <cstdint>
@@ -139,6 +109,7 @@
139109
#include "absl/container/internal/container_memory.h"
140110
#include "absl/container/internal/hash_policy_traits.h"
141111
#include "absl/container/internal/hashtable_debug_hooks.h"
112+
#include "absl/container/internal/have_sse.h"
142113
#include "absl/container/internal/layout.h"
143114
#include "absl/memory/memory.h"
144115
#include "absl/meta/type_traits.h"

absl/copts/GENERATED_AbseilCopts.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GENERATED! DO NOT MANUALLY EDIT THIS FILE.
22
#
33
# (1) Edit absl/copts/copts.py.
4-
# (2) Run `<path_to_absl>/copts/generate_copts.py`.
4+
# (2) Run `python <path_to_absl>/copts/generate_copts.py`.
55

66
list(APPEND GCC_EXCEPTIONS_FLAGS
77
"-fexceptions"
@@ -48,6 +48,7 @@ list(APPEND LLVM_FLAGS
4848
"-Wno-double-promotion"
4949
"-Wno-comma"
5050
"-Wno-extra-semi"
51+
"-Wno-extra-semi-stmt"
5152
"-Wno-packed"
5253
"-Wno-padded"
5354
"-Wno-sign-compare"

absl/copts/GENERATED_copts.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""GENERATED! DO NOT MANUALLY EDIT THIS FILE.
22
33
(1) Edit absl/copts/copts.py.
4-
(2) Run `<path_to_absl>/copts/generate_copts.py`.
4+
(2) Run `python <path_to_absl>/copts/generate_copts.py`.
55
"""
66

77
GCC_EXCEPTIONS_FLAGS = [
@@ -49,6 +49,7 @@ LLVM_FLAGS = [
4949
"-Wno-double-promotion",
5050
"-Wno-comma",
5151
"-Wno-extra-semi",
52+
"-Wno-extra-semi-stmt",
5253
"-Wno-packed",
5354
"-Wno-padded",
5455
"-Wno-sign-compare",

absl/copts/copts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
This is the source of truth for Abseil compiler options. To modify Abseil
44
compilation options:
55
6-
(1) Edit the appropriate list in this file.
6+
(1) Edit the appropriate list in this file based on the platform the flag is
7+
needed on.
78
(2) Run `<path_to_absl>/copts/generate_copts.py`.
89
910
The generated copts are consumed by configure_copts.bzl and
1011
AbseilConfigureCopts.cmake.
1112
"""
1213

1314
import collections # absl:google-only(used for internal flags)
14-
1515
COPT_VARS = {
1616
"GCC_FLAGS": [
1717
"-Wall",

absl/synchronization/mutex.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ void Mutex::TryRemove(PerThreadSynch *s) {
10791079
// if the wait extends past the absolute time specified, even if "s" is still
10801080
// on the mutex queue. In this case, remove "s" from the queue and return
10811081
// true, otherwise return false.
1082-
void Mutex::Block(PerThreadSynch *s) {
1082+
ABSL_XRAY_LOG_ARGS(1) void Mutex::Block(PerThreadSynch *s) {
10831083
while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) {
10841084
if (!DecrementSynchSem(this, s, s->waitp->timeout)) {
10851085
// After a timeout, we go into a spin loop until we remove ourselves

0 commit comments

Comments
 (0)