Export of internal Abseil changes

--
d8a1e7f8059a0bc4cd72b4e4ca2947322c36f7ee by Martijn Vels <mvels@google.com>:

Add cordz allowlist and cleanup COPTS

PiperOrigin-RevId: 372042499

--
2abd20ac17127b8823787bfcdd3e7e80709d3034 by Evan Brown <ezb@google.com>:

Remove unnecessary string conversion now that FormatTime accepts string_view.

PiperOrigin-RevId: 371989142
GitOrigin-RevId: d8a1e7f8059a0bc4cd72b4e4ca2947322c36f7ee
Change-Id: I637e9fa434de9b2c38fd0f96d66eefc6e8eec8e8
pull/963/head
Abseil Team 4 years ago committed by Andy Getz
parent cba8cf87bc
commit 037ade20d1
  1. 22
      absl/strings/BUILD.bazel
  2. 14
      absl/strings/CMakeLists.txt
  3. 4
      absl/time/civil_time.cc

@ -300,7 +300,9 @@ cc_library(
name = "cordz_update_tracker",
hdrs = ["internal/cordz_update_tracker.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = ["//visibility:private"],
visibility = [
"//absl:__subpackages__",
],
deps = ["//absl/base:config"],
)
@ -353,6 +355,9 @@ cc_library(
srcs = ["internal/cordz_handle.cc"],
hdrs = ["internal/cordz_handle.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
"//absl/base",
"//absl/base:config",
@ -366,6 +371,9 @@ cc_library(
srcs = ["internal/cordz_info.cc"],
hdrs = ["internal/cordz_info.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
":cord_internal",
":cordz_functions",
@ -387,6 +395,9 @@ cc_library(
name = "cordz_update_scope",
hdrs = ["internal/cordz_update_scope.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
":cord_internal",
":cordz_info",
@ -416,6 +427,9 @@ cc_library(
srcs = ["internal/cordz_sample_token.cc"],
hdrs = ["internal/cordz_sample_token.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
":cordz_handle",
":cordz_info",
@ -428,6 +442,9 @@ cc_library(
srcs = ["internal/cordz_functions.cc"],
hdrs = ["internal/cordz_functions.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
"//absl/base:config",
"//absl/base:core_headers",
@ -440,6 +457,9 @@ cc_library(
name = "cordz_statistics",
hdrs = ["internal/cordz_statistics.h"],
copts = ABSL_DEFAULT_COPTS,
visibility = [
"//absl:__subpackages__",
],
deps = [
":cordz_update_tracker",
"//absl/base:config",

@ -259,7 +259,7 @@ absl_cc_test(
absl_cc_test(
NAME
str_join_test
ss SRCS
SRCS
"str_join_test.cc"
COPTS
${ABSL_TEST_COPTS}
@ -562,7 +562,7 @@ absl_cc_library(
"internal/cord_internal.cc"
"internal/cord_rep_ring.cc"
COPTS
${ABSL_TEST_COPTS}
${ABSL_DEFAULT_COPTS}
DEPS
absl::base_internal
absl::compressed_tuple
@ -583,7 +583,7 @@ absl_cc_library(
HDRS
"internal/cordz_update_tracker.h"
COPTS
${ABSL_TEST_COPTS}
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
)
@ -708,6 +708,8 @@ absl_cc_test(
cordz_info_test
SRCS
"internal/cordz_info_test.cc"
COPTS
${ABSL_TEST_COPTS}
DEPS
absl::config
absl::cord_internal
@ -728,6 +730,8 @@ absl_cc_test(
cordz_info_statistics_test
SRCS
"internal/cordz_info_statistics_test.cc"
COPTS
${ABSL_TEST_COPTS}
DEPS
absl::config
absl::cord
@ -762,7 +766,7 @@ absl_cc_test(
SRCS
"internal/cordz_sample_token_test.cc"
COPTS
${ABSL_DEFAULT_COPTS}
${ABSL_TEST_COPTS}
DEPS
absl::config
absl::cord_internal
@ -785,7 +789,7 @@ absl_cc_library(
HDRS
"internal/cordz_update_scope.h"
COPTS
${ABSL_TEST_COPTS}
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
absl::cord_internal

@ -38,9 +38,7 @@ std::string FormatYearAnd(string_view fmt, CivilSecond cs) {
const CivilSecond ncs(NormalizeYear(cs.year()), cs.month(), cs.day(),
cs.hour(), cs.minute(), cs.second());
const TimeZone utc = UTCTimeZone();
// TODO(absl-team): Avoid conversion of fmt string.
return StrCat(cs.year(),
FormatTime(std::string(fmt), FromCivil(ncs, utc), utc));
return StrCat(cs.year(), FormatTime(fmt, FromCivil(ncs, utc), utc));
}
template <typename CivilT>

Loading…
Cancel
Save