Export of internal Abseil changes
-- 62de74cdadc450a28eaa61a2db0912c97c8004dd by Abseil Team <absl-team@google.com>: Move "internal/flag.*" files to the "internal" build target. PiperOrigin-RevId: 268301646 -- 72cd87aebd52fa7e7ee7cff0284f3761dd490945 by CJ Johnson <johnsoncj@google.com>: Silences incorrect test failure for InlinedVector in MSVC debug mode. PiperOrigin-RevId: 268234003 GitOrigin-RevId: 62de74cdadc450a28eaa61a2db0912c97c8004dd Change-Id: I6b58e41561de6ac2e34cf5c1eedbf535dc468955
This commit is contained in:
parent
97c1664b4b
commit
5374c56e51
3 changed files with 99 additions and 26 deletions
|
@ -1689,7 +1689,11 @@ TEST(AllocatorSupportTest, ScopedAllocatorWorksInlined) {
|
||||||
inlined_case.emplace_back();
|
inlined_case.emplace_back();
|
||||||
|
|
||||||
int64_t absl_responsible_for_count = total_allocated_byte_count;
|
int64_t absl_responsible_for_count = total_allocated_byte_count;
|
||||||
|
|
||||||
|
// MSVC's allocator preemptively allocates in debug mode
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
EXPECT_EQ(absl_responsible_for_count, 0);
|
EXPECT_EQ(absl_responsible_for_count, 0);
|
||||||
|
#endif // !defined(_MSC_VER)
|
||||||
|
|
||||||
inlined_case[0].emplace_back();
|
inlined_case[0].emplace_back();
|
||||||
EXPECT_GT(total_allocated_byte_count, absl_responsible_for_count);
|
EXPECT_GT(total_allocated_byte_count, absl_responsible_for_count);
|
||||||
|
|
|
@ -28,11 +28,30 @@ licenses(["notice"]) # Apache 2.0
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "internal",
|
name = "internal",
|
||||||
|
srcs = [
|
||||||
|
"internal/flag.cc",
|
||||||
|
],
|
||||||
|
hdrs = [
|
||||||
|
"internal/flag.h",
|
||||||
|
],
|
||||||
|
copts = ABSL_DEFAULT_COPTS,
|
||||||
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
|
visibility = [
|
||||||
|
"//absl/flags:__pkg__",
|
||||||
|
],
|
||||||
|
deps = [
|
||||||
|
":handle",
|
||||||
|
":registry",
|
||||||
|
"//absl/synchronization",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "program_name",
|
||||||
srcs = [
|
srcs = [
|
||||||
"internal/program_name.cc",
|
"internal/program_name.cc",
|
||||||
],
|
],
|
||||||
hdrs = [
|
hdrs = [
|
||||||
"internal/path_util.h",
|
|
||||||
"internal/program_name.h",
|
"internal/program_name.h",
|
||||||
],
|
],
|
||||||
copts = ABSL_DEFAULT_COPTS,
|
copts = ABSL_DEFAULT_COPTS,
|
||||||
|
@ -41,11 +60,27 @@ cc_library(
|
||||||
"//absl/flags:__pkg__",
|
"//absl/flags:__pkg__",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
":path_util",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"//absl/synchronization",
|
"//absl/synchronization",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "path_util",
|
||||||
|
hdrs = [
|
||||||
|
"internal/path_util.h",
|
||||||
|
],
|
||||||
|
copts = ABSL_DEFAULT_COPTS,
|
||||||
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
|
visibility = [
|
||||||
|
"//absl/flags:__pkg__",
|
||||||
|
],
|
||||||
|
deps = [
|
||||||
|
"//absl/strings",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "config",
|
name = "config",
|
||||||
srcs = [
|
srcs = [
|
||||||
|
@ -58,7 +93,8 @@ cc_library(
|
||||||
copts = ABSL_DEFAULT_COPTS,
|
copts = ABSL_DEFAULT_COPTS,
|
||||||
linkopts = ABSL_DEFAULT_LINKOPTS,
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":internal",
|
":path_util",
|
||||||
|
":program_name",
|
||||||
"//absl/base:core_headers",
|
"//absl/base:core_headers",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"//absl/synchronization",
|
"//absl/synchronization",
|
||||||
|
@ -136,24 +172,21 @@ cc_library(
|
||||||
name = "flag",
|
name = "flag",
|
||||||
srcs = [
|
srcs = [
|
||||||
"flag.cc",
|
"flag.cc",
|
||||||
"internal/flag.cc",
|
|
||||||
],
|
],
|
||||||
hdrs = [
|
hdrs = [
|
||||||
"declare.h",
|
"declare.h",
|
||||||
"flag.h",
|
"flag.h",
|
||||||
"internal/flag.h",
|
|
||||||
],
|
],
|
||||||
copts = ABSL_DEFAULT_COPTS,
|
copts = ABSL_DEFAULT_COPTS,
|
||||||
linkopts = ABSL_DEFAULT_LINKOPTS,
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":config",
|
":config",
|
||||||
":handle",
|
":handle",
|
||||||
|
":internal",
|
||||||
":marshalling",
|
":marshalling",
|
||||||
":registry",
|
|
||||||
"//absl/base",
|
"//absl/base",
|
||||||
"//absl/base:core_headers",
|
"//absl/base:core_headers",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"//absl/synchronization",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -174,7 +207,8 @@ cc_library(
|
||||||
":config",
|
":config",
|
||||||
":flag",
|
":flag",
|
||||||
":handle",
|
":handle",
|
||||||
":internal",
|
":path_util",
|
||||||
|
":program_name",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"//absl/synchronization",
|
"//absl/synchronization",
|
||||||
],
|
],
|
||||||
|
@ -209,8 +243,7 @@ cc_library(
|
||||||
deps = [
|
deps = [
|
||||||
":config",
|
":config",
|
||||||
":flag",
|
":flag",
|
||||||
":handle",
|
":program_name",
|
||||||
":internal",
|
|
||||||
":registry",
|
":registry",
|
||||||
":usage",
|
":usage",
|
||||||
":usage_internal",
|
":usage_internal",
|
||||||
|
@ -295,7 +328,7 @@ cc_test(
|
||||||
copts = ABSL_TEST_COPTS,
|
copts = ABSL_TEST_COPTS,
|
||||||
linkopts = ABSL_DEFAULT_LINKOPTS,
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":internal",
|
":path_util",
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -328,7 +361,7 @@ cc_test(
|
||||||
copts = ABSL_TEST_COPTS,
|
copts = ABSL_TEST_COPTS,
|
||||||
linkopts = ABSL_DEFAULT_LINKOPTS,
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":internal",
|
":program_name",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
],
|
],
|
||||||
|
@ -361,7 +394,8 @@ cc_test(
|
||||||
linkopts = ABSL_DEFAULT_LINKOPTS,
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":config",
|
":config",
|
||||||
":internal",
|
":path_util",
|
||||||
|
":program_name",
|
||||||
"//absl/strings",
|
"//absl/strings",
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
],
|
],
|
||||||
|
@ -378,8 +412,9 @@ cc_test(
|
||||||
deps = [
|
deps = [
|
||||||
":config",
|
":config",
|
||||||
":flag",
|
":flag",
|
||||||
":internal",
|
|
||||||
":parse",
|
":parse",
|
||||||
|
":path_util",
|
||||||
|
":program_name",
|
||||||
":usage",
|
":usage",
|
||||||
":usage_internal",
|
":usage_internal",
|
||||||
"//absl/memory",
|
"//absl/memory",
|
||||||
|
|
|
@ -18,21 +18,55 @@
|
||||||
absl_cc_library(
|
absl_cc_library(
|
||||||
NAME
|
NAME
|
||||||
flags_internal
|
flags_internal
|
||||||
|
SRCS
|
||||||
|
"internal/flag.cc"
|
||||||
|
HDRS
|
||||||
|
"internal/flag.h"
|
||||||
|
COPTS
|
||||||
|
${ABSL_DEFAULT_COPTS}
|
||||||
|
LINKOPTS
|
||||||
|
${ABSL_DEFAULT_LINKOPTS}
|
||||||
|
DEPS
|
||||||
|
absl::flags_handle
|
||||||
|
absl::flags_registry
|
||||||
|
absl::synchronization
|
||||||
|
PUBLIC
|
||||||
|
)
|
||||||
|
|
||||||
|
# Internal-only target, do not depend on directly.
|
||||||
|
absl_cc_library(
|
||||||
|
NAME
|
||||||
|
flags_program_name
|
||||||
SRCS
|
SRCS
|
||||||
"internal/program_name.cc"
|
"internal/program_name.cc"
|
||||||
HDRS
|
HDRS
|
||||||
"internal/path_util.h"
|
|
||||||
"internal/program_name.h"
|
"internal/program_name.h"
|
||||||
COPTS
|
COPTS
|
||||||
${ABSL_DEFAULT_COPTS}
|
${ABSL_DEFAULT_COPTS}
|
||||||
LINKOPTS
|
LINKOPTS
|
||||||
${ABSL_DEFAULT_LINKOPTS}
|
${ABSL_DEFAULT_LINKOPTS}
|
||||||
DEPS
|
DEPS
|
||||||
|
absl::flags_path_util
|
||||||
absl::strings
|
absl::strings
|
||||||
absl::synchronization
|
absl::synchronization
|
||||||
PUBLIC
|
PUBLIC
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Internal-only target, do not depend on directly.
|
||||||
|
absl_cc_library(
|
||||||
|
NAME
|
||||||
|
flags_path_util
|
||||||
|
HDRS
|
||||||
|
"internal/path_util.h"
|
||||||
|
COPTS
|
||||||
|
${ABSL_DEFAULT_COPTS}
|
||||||
|
LINKOPTS
|
||||||
|
${ABSL_DEFAULT_LINKOPTS}
|
||||||
|
DEPS
|
||||||
|
absl::strings
|
||||||
|
PUBLIC
|
||||||
|
)
|
||||||
|
|
||||||
absl_cc_library(
|
absl_cc_library(
|
||||||
NAME
|
NAME
|
||||||
flags_config
|
flags_config
|
||||||
|
@ -46,7 +80,8 @@ absl_cc_library(
|
||||||
LINKOPTS
|
LINKOPTS
|
||||||
${ABSL_DEFAULT_LINKOPTS}
|
${ABSL_DEFAULT_LINKOPTS}
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_internal
|
absl::flags_path_util
|
||||||
|
absl::flags_program_name
|
||||||
absl::core_headers
|
absl::core_headers
|
||||||
absl::strings
|
absl::strings
|
||||||
absl::synchronization
|
absl::synchronization
|
||||||
|
@ -120,11 +155,9 @@ absl_cc_library(
|
||||||
flags
|
flags
|
||||||
SRCS
|
SRCS
|
||||||
"flag.cc"
|
"flag.cc"
|
||||||
"internal/flag.cc"
|
|
||||||
HDRS
|
HDRS
|
||||||
"declare.h"
|
"declare.h"
|
||||||
"flag.h"
|
"flag.h"
|
||||||
"internal/flag.h"
|
|
||||||
COPTS
|
COPTS
|
||||||
${ABSL_DEFAULT_COPTS}
|
${ABSL_DEFAULT_COPTS}
|
||||||
LINKOPTS
|
LINKOPTS
|
||||||
|
@ -132,12 +165,11 @@ absl_cc_library(
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_config
|
absl::flags_config
|
||||||
absl::flags_handle
|
absl::flags_handle
|
||||||
|
absl::flags_internal
|
||||||
absl::flags_marshalling
|
absl::flags_marshalling
|
||||||
absl::flags_registry
|
|
||||||
absl::base
|
absl::base
|
||||||
absl::core_headers
|
absl::core_headers
|
||||||
absl::strings
|
absl::strings
|
||||||
absl::synchronization
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Internal-only target, do not depend on directly.
|
# Internal-only target, do not depend on directly.
|
||||||
|
@ -156,7 +188,8 @@ absl_cc_library(
|
||||||
absl::flags_config
|
absl::flags_config
|
||||||
absl::flags
|
absl::flags
|
||||||
absl::flags_handle
|
absl::flags_handle
|
||||||
absl::flags_internal
|
absl::flags_path_util
|
||||||
|
absl::flags_program_name
|
||||||
absl::strings
|
absl::strings
|
||||||
absl::synchronization
|
absl::synchronization
|
||||||
)
|
)
|
||||||
|
@ -193,8 +226,7 @@ absl_cc_library(
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_config
|
absl::flags_config
|
||||||
absl::flags
|
absl::flags
|
||||||
absl::flags_handle
|
absl::flags_program_name
|
||||||
absl::flags_internal
|
|
||||||
absl::flags_registry
|
absl::flags_registry
|
||||||
absl::flags_usage
|
absl::flags_usage
|
||||||
absl::strings
|
absl::strings
|
||||||
|
@ -285,7 +317,7 @@ absl_cc_test(
|
||||||
COPTS
|
COPTS
|
||||||
${ABSL_TEST_COPTS}
|
${ABSL_TEST_COPTS}
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_internal
|
absl::flags_path_util
|
||||||
gtest_main
|
gtest_main
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -297,7 +329,7 @@ absl_cc_test(
|
||||||
COPTS
|
COPTS
|
||||||
${ABSL_TEST_COPTS}
|
${ABSL_TEST_COPTS}
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_internal
|
absl::flags_program_name
|
||||||
absl::strings
|
absl::strings
|
||||||
gtest_main
|
gtest_main
|
||||||
)
|
)
|
||||||
|
@ -326,7 +358,8 @@ absl_cc_test(
|
||||||
${ABSL_TEST_COPTS}
|
${ABSL_TEST_COPTS}
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_config
|
absl::flags_config
|
||||||
absl::flags_internal
|
absl::flags_path_util
|
||||||
|
absl::flags_program_name
|
||||||
absl::strings
|
absl::strings
|
||||||
gtest_main
|
gtest_main
|
||||||
)
|
)
|
||||||
|
@ -341,7 +374,8 @@ absl_cc_test(
|
||||||
DEPS
|
DEPS
|
||||||
absl::flags_config
|
absl::flags_config
|
||||||
absl::flags
|
absl::flags
|
||||||
absl::flags_internal
|
absl::flags_path_util
|
||||||
|
absl::flags_program_name
|
||||||
absl::flags_parse
|
absl::flags_parse
|
||||||
absl::flags_usage
|
absl::flags_usage
|
||||||
absl::memory
|
absl::memory
|
||||||
|
|
Loading…
Reference in a new issue