Commit f3cd636f by mwinterb Committed by Dominic Hamon

Always use inline asm DoNotOptimize with clang. (#452)

* Always use inline asm DoNotOptimize with clang. clang-cl masquerades as MSVC but not GCC, so it was using the MSVC-compatible definitions of DoNotOptimize and ClobberMemory. Presumably, it's better in general to use the targeted assembly for this functionality (the codegen is different), but the specific issue is that clang-cl deprecates the usage of _ReadWriteBarrier, and this gets rid of that warning. * triggering another AppVeyor run
parent 819adb4c
...@@ -290,10 +290,12 @@ BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams(); ...@@ -290,10 +290,12 @@ BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams();
} // namespace internal } // namespace internal
#if !defined(__GNUC__) || defined(__pnacl__) || defined(EMSCRIPTN) #if (!defined(__GNUC__) && !defined(__clang__)) || defined(__pnacl__) || \
defined(EMSCRIPTN)
# define BENCHMARK_HAS_NO_INLINE_ASSEMBLY # define BENCHMARK_HAS_NO_INLINE_ASSEMBLY
#endif #endif
// The DoNotOptimize(...) function can be used to prevent a value or // The DoNotOptimize(...) function can be used to prevent a value or
// expression from being optimized away by the compiler. This function is // expression from being optimized away by the compiler. This function is
// intended to add little to no overhead. // intended to add little to no overhead.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment