[PATCH] D29919: allow migrating away from cmake option for LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING

Bob Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 17:39:46 PST 2017


bob.wilson created this revision.
Herald added subscribers: mgorny, mcrosier.

In r288754, Mehdi added a cmake option to disable enforcement of the ABI breaking checks in the "abi-breaking.h" header. We used that when building Swift and it works, but I think it will be better to control this with a preprocessor macro instead of a cmake option. That will let us opt out of the enforcement more selectively.

This change allows skipping the cmake setting if the existing preprocessor macro is already defined. My intention here is to make this change and get Swift to use it, and then after a few weeks, we can remove the cmake option. I want to stage it like that to be less disruptive. I'm not aware of anyone else using that cmake option.

Mehdi had some initial concern about the impact of using a preprocessor macro when building with modules enabled. I don't think that will be a problem if we set the macro on the command line with a -D option in those contexts where we need to disable the enforcement of the checks.


https://reviews.llvm.org/D29919

Files:
  llvm/Config/abi-breaking.h.cmake


Index: llvm/Config/abi-breaking.h.cmake
===================================================================
--- llvm/Config/abi-breaking.h.cmake
+++ llvm/Config/abi-breaking.h.cmake
@@ -17,7 +17,9 @@
 
 /* Define to disable the link-time checking of mismatch for
    LLVM_ENABLE_ABI_BREAKING_CHECKS */
+#ifndef LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
 #cmakedefine01 LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
+#endif
 #if !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
 
 // ABI_BREAKING_CHECKS protection: provides link-time failure when clients build


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29919.88286.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170214/aa9dee86/attachment.bin>


More information about the llvm-commits mailing list