summaryrefslogtreecommitdiff
path: root/absl/log/internal/strip.h
diff options
context:
space:
mode:
authorGravatar Andy Getzendanner <durandal@google.com>2023-04-28 14:37:49 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-28 14:38:29 -0700
commite9a7eea615352e2f74c13585a4b031f868b3bfa7 (patch)
tree8a3ac4ca7d40ffb5c7282dc55e4ffa3448842817 /absl/log/internal/strip.h
parent56c5fc620161e12844b9b92d06f8954b29f40bf4 (diff)
Shrink most LOG callsites by one instruction (SysV x86_64 ABI) by dispatching to per-severity constructors and omitting the severity argument.
In that particular ABI, the empty tag structs are NO_CLASS and don't appear in the generated code. https://godbolt.org/z/crqaPh8Kv PiperOrigin-RevId: 527989179 Change-Id: I365f11f6ca1de2623690d0a04e6f02f7de82b1fc
Diffstat (limited to 'absl/log/internal/strip.h')
-rw-r--r--absl/log/internal/strip.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/absl/log/internal/strip.h b/absl/log/internal/strip.h
index 848c3867..adc86ffd 100644
--- a/absl/log/internal/strip.h
+++ b/absl/log/internal/strip.h
@@ -42,15 +42,15 @@
#define ABSL_LOG_INTERNAL_QCHECK(failure_message) \
ABSL_LOGGING_INTERNAL_LOG_QFATAL
#else // !defined(STRIP_LOG) || !STRIP_LOG
-#define ABSL_LOGGING_INTERNAL_LOG_INFO \
- ::absl::log_internal::LogMessage(__FILE__, __LINE__, \
- ::absl::LogSeverity::kInfo)
-#define ABSL_LOGGING_INTERNAL_LOG_WARNING \
- ::absl::log_internal::LogMessage(__FILE__, __LINE__, \
- ::absl::LogSeverity::kWarning)
-#define ABSL_LOGGING_INTERNAL_LOG_ERROR \
- ::absl::log_internal::LogMessage(__FILE__, __LINE__, \
- ::absl::LogSeverity::kError)
+#define ABSL_LOGGING_INTERNAL_LOG_INFO \
+ ::absl::log_internal::LogMessage( \
+ __FILE__, __LINE__, ::absl::log_internal::LogMessage::InfoTag{})
+#define ABSL_LOGGING_INTERNAL_LOG_WARNING \
+ ::absl::log_internal::LogMessage( \
+ __FILE__, __LINE__, ::absl::log_internal::LogMessage::WarningTag{})
+#define ABSL_LOGGING_INTERNAL_LOG_ERROR \
+ ::absl::log_internal::LogMessage( \
+ __FILE__, __LINE__, ::absl::log_internal::LogMessage::ErrorTag{})
#define ABSL_LOGGING_INTERNAL_LOG_FATAL \
::absl::log_internal::LogMessageFatal(__FILE__, __LINE__)
#define ABSL_LOGGING_INTERNAL_LOG_QFATAL \