[PATCH] D26876: Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 16:21:49 PST 2016


mehdi_amini created this revision.
mehdi_amini added reviewers: jroelofs, rnk.
mehdi_amini added a subscriber: llvm-commits.
Herald added subscribers: modocache, mgorny.

The macro LLVM_ENABLE_ABI_BREAKING_CHECKS is moved to a new header
abi-breaking.h, from llvm-config.h. Only headers that are using the
macro are include this new header.

LLVM will define a symbol, either EnableABIBreakingChecks or
DisableABIBreakingChecks depending on the configuration setting for
LLVM_ABI_BREAKING_CHECKS.

The abi-breaking.h header will add weak references to these symbols in
every clients that includes this header. This should ensure that
a mismatch triggers a link failure (or a load time failure for DSO).

On MSVC, the pragma "detect_mismatch" is used instead.


https://reviews.llvm.org/D26876

Files:
  llvm/CMakeLists.txt
  llvm/include/llvm/ADT/EpochTracker.h
  llvm/include/llvm/ADT/ilist_node_options.h
  llvm/include/llvm/Config/abi-breaking.h.cmake
  llvm/include/llvm/Config/config.h.cmake
  llvm/include/llvm/Config/llvm-config.h.cmake
  llvm/include/llvm/Support/Error.h
  llvm/lib/Support/Error.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26876.78597.patch
Type: text/x-patch
Size: 5334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161119/1df103fd/attachment.bin>


More information about the llvm-commits mailing list