aboutsummaryrefslogtreecommitdiff
path: root/absl/hash/hash_benchmark.cc
diff options
context:
space:
mode:
authorShahriar Rouf <nafi@google.com>2023-12-05 10:43:45 -0800
committerCopybara-Service <copybara-worker@google.com>2023-12-05 10:44:38 -0800
commit71d553b12397ef81e9111b4fa21c68af3c0bf8b9 (patch)
tree3221199ec215d22ad1880d4011c05334ef0dd321 /absl/hash/hash_benchmark.cc
parentf845e60acd880dbf07788a5a2c0dbad0f9c57231 (diff)
downloadabseil-71d553b12397ef81e9111b4fa21c68af3c0bf8b9.tar.gz
abseil-71d553b12397ef81e9111b4fa21c68af3c0bf8b9.tar.bz2
abseil-71d553b12397ef81e9111b4fa21c68af3c0bf8b9.zip
Fix codegen trunks in `absl/hash/hash_benchmark.cc`.
PiperOrigin-RevId: 588121665 Change-Id: Id057772e426aefe2fe7b2f1e94fd405b97167fed
Diffstat (limited to 'absl/hash/hash_benchmark.cc')
-rw-r--r--absl/hash/hash_benchmark.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/absl/hash/hash_benchmark.cc b/absl/hash/hash_benchmark.cc
index 916fb620..d18ea694 100644
--- a/absl/hash/hash_benchmark.cc
+++ b/absl/hash/hash_benchmark.cc
@@ -85,12 +85,6 @@ struct TypeErasedAbslHash {
}
};
-template <typename FuncType>
-inline FuncType* ODRUseFunction(FuncType* ptr) {
- volatile FuncType* dummy = ptr;
- return dummy;
-}
-
absl::Cord FlatCord(size_t size) {
absl::Cord result(std::string(size, 'a'));
result.Flatten();
@@ -166,7 +160,7 @@ absl::flat_hash_set<T> FlatHashSet(size_t count) {
return hash<decltype(__VA_ARGS__)>{}(arg); \
} \
bool absl_hash_test_odr_use##hash##name = \
- ODRUseFunction(&Codegen##hash##name);
+ (benchmark::DoNotOptimize(&Codegen##hash##name), false);
MAKE_BENCHMARK(AbslHash, Int32, int32_t{});
MAKE_BENCHMARK(AbslHash, Int64, int64_t{});