[llvm] r346237 - [benchmark] Disable exceptions in Microsoft STL

Elizabeth Andrews via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 07:57:59 PST 2018


Author: eandrews
Date: Tue Nov  6 07:57:59 2018
New Revision: 346237

URL: http://llvm.org/viewvc/llvm-project?rev=346237&view=rev
Log:
[benchmark] Disable exceptions in Microsoft STL

This patch disables exceptions in Microsoft STL when exception 
handling is not enabled in Benchmark project. It fixes Windows 
builds that were failing due to C4530 warnings thrown by MS STL.

Differential Revision: https://reviews.llvm.org/D52998

Modified:
    llvm/trunk/utils/benchmark/CMakeLists.txt
    llvm/trunk/utils/benchmark/README.LLVM

Modified: llvm/trunk/utils/benchmark/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/CMakeLists.txt?rev=346237&r1=346236&r2=346237&view=diff
==============================================================================
--- llvm/trunk/utils/benchmark/CMakeLists.txt (original)
+++ llvm/trunk/utils/benchmark/CMakeLists.txt Tue Nov  6 07:57:59 2018
@@ -99,6 +99,7 @@ if (MSVC)
   if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
     add_cxx_compiler_flag(-EHs-)
     add_cxx_compiler_flag(-EHa-)
+    add_definitions(-D_HAS_EXCEPTIONS=0)
   endif()
   # Link time optimisation
   if (BENCHMARK_ENABLE_LTO)

Modified: llvm/trunk/utils/benchmark/README.LLVM
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/README.LLVM?rev=346237&r1=346236&r2=346237&view=diff
==============================================================================
--- llvm/trunk/utils/benchmark/README.LLVM (original)
+++ llvm/trunk/utils/benchmark/README.LLVM Tue Nov  6 07:57:59 2018
@@ -19,3 +19,5 @@ Changes:
   is applied to fix cross compilation with MinGW headers
 * https://github.com/google/benchmark/commit/439d6b1c2a6da5cb6adc4c4dfc555af235722396
   is applied to fix building with MinGW headers for ARM
+* https://github.com/google/benchmark/commit/a9b31c51b1ee7ec7b31438c647123c2cbac5d956
+  is applied to disable exceptions in Microsoft STL when exceptions are disabled




More information about the llvm-commits mailing list