about summary refs log tree commit diff
path: root/absl/flags/flag_benchmark.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/flag_benchmark.cc')
-rw-r--r--absl/flags/flag_benchmark.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/absl/flags/flag_benchmark.cc b/absl/flags/flag_benchmark.cc
index 87f731704c87..ff95bb5d7bfc 100644
--- a/absl/flags/flag_benchmark.cc
+++ b/absl/flags/flag_benchmark.cc
@@ -109,3 +109,11 @@ namespace {
 BENCHMARKED_TYPES(BM_GetFlag)
 
 }  // namespace
+
+#define InvokeGetFlag(T)                                               \
+  T AbslInvokeGetFlag##T() { return absl::GetFlag(FLAGS_##T##_flag); } \
+  int odr##T = (benchmark::DoNotOptimize(AbslInvokeGetFlag##T), 1);
+
+BENCHMARKED_TYPES(InvokeGetFlag)
+
+// To veiw disassembly use: gdb ${BINARY}  -batch -ex "disassemble /s $FUNC"