Export of internal Abseil changes.
-- 821196cfb2a3b943ffdc4c9e75daec92d7ffb28b by Abseil Team <absl-team@google.com>: Performance improvements PiperOrigin-RevId: 212668992 -- 704858e2e767016bad27d53eec01d9d48e546b23 by Abseil Team <absl-team@google.com>: Low-level Portability enchancements for Abseil Mutex on WebAssembly. Emscripten Pthreads do not use signals, so remove use of pthread_sigmask or other async-signal-safe related handling code. PiperOrigin-RevId: 212527958 -- be3e38cb4d493b755132d20c8c2d1a51e45d5449 by Jon Cohen <cohenjon@google.com>: Internal change. PiperOrigin-RevId: 212523797 GitOrigin-RevId: 821196cfb2a3b943ffdc4c9e75daec92d7ffb28b Change-Id: I5694e23e4e09364a15dd6fc4e2e3f15e38835687
This commit is contained in:
parent
02451914b9
commit
8ff1374008
9 changed files with 198 additions and 170 deletions
|
|
@ -601,3 +601,39 @@ TEST_F(ParsedFormatTest, RegressionMixPositional) {
|
|||
|
||||
} // namespace
|
||||
} // namespace absl
|
||||
|
||||
// Some codegen thunks that we can use to easily dump the generated assembly for
|
||||
// different StrFormat calls.
|
||||
|
||||
inline std::string CodegenAbslStrFormatInt(int i) {
|
||||
return absl::StrFormat("%d", i);
|
||||
}
|
||||
|
||||
inline std::string CodegenAbslStrFormatIntStringInt64(int i, const std::string& s,
|
||||
int64_t i64) {
|
||||
return absl::StrFormat("%d %s %d", i, s, i64);
|
||||
}
|
||||
|
||||
inline void CodegenAbslStrAppendFormatInt(std::string* out, int i) {
|
||||
absl::StrAppendFormat(out, "%d", i);
|
||||
}
|
||||
|
||||
inline void CodegenAbslStrAppendFormatIntStringInt64(std::string* out, int i,
|
||||
const std::string& s,
|
||||
int64_t i64) {
|
||||
absl::StrAppendFormat(out, "%d %s %d", i, s, i64);
|
||||
}
|
||||
|
||||
auto absl_internal_str_format_force_codegen_funcs = std::make_tuple(
|
||||
CodegenAbslStrFormatInt, CodegenAbslStrFormatIntStringInt64,
|
||||
CodegenAbslStrAppendFormatInt, CodegenAbslStrAppendFormatIntStringInt64);
|
||||
|
||||
bool absl_internal_str_format_force_codegen_always_false;
|
||||
// Force the compiler to generate the functions by making it look like we
|
||||
// escape the function pointers.
|
||||
// It can't statically know that
|
||||
// absl_internal_str_format_force_codegen_always_false is not changed by someone
|
||||
// else.
|
||||
bool absl_internal_str_format_force_codegen =
|
||||
absl_internal_str_format_force_codegen_always_false &&
|
||||
printf("%p", &absl_internal_str_format_force_codegen_funcs) == 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue