[PATCH] D52998: [benchmark] Disable exceptions in Microsoft STL

Elizabeth Andrews via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 1 10:37:27 PDT 2018


eandrews updated this revision to Diff 172171.
eandrews added a comment.

@kbobyrev  I apologize if I was unclear in the comments. I was asking if the changes proposed in the comments are alright with you since they would involve modifying `benchmark/CMakelists.txt` (instead of `llvm/CMakeLists.txt` as discussed in mailing list). As Zachary mentioned in comments, `_HAS_EXCEPTIONS` should be set to 0 only when exceptions are disabled. Since exception handling for benchmarks is handled in `benchmark/CMakeLists.txt`, I think it makes most sense to add the definition there. I have now uploaded the proposed change for review.

I am still working with my company to figure out the corporate CLA Google's benchmark project requires for patch submissions. I can submit the patch upstream once that is done. If you would prefer to submit the patch upstream yourself, please feel free to do so.

Sorry again for the confusion!


https://reviews.llvm.org/D52998

Files:
  utils/benchmark/CMakeLists.txt


Index: utils/benchmark/CMakeLists.txt
===================================================================
--- utils/benchmark/CMakeLists.txt
+++ utils/benchmark/CMakeLists.txt
@@ -99,6 +99,7 @@
   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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52998.172171.patch
Type: text/x-patch
Size: 412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181101/e3734195/attachment.bin>


More information about the cfe-commits mailing list