[PATCH] D30977: [CodeGen] Emit a CoreFoundation link guard when @available is used

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 15 05:12:17 PDT 2017


arphaman created this revision.

After r297760, __isOSVersionAtLeast in compiler-rt loads the CoreFoundation symbols at runtime. This means that `@available` will always fail when used in a binary without a linked CoreFoundation.

This patch forces Clang to emit a reference to a CoreFoundation symbol when `@available` is used to ensure that linking will fail when CoreFoundation isn't linked with the build product.


Repository:
  rL LLVM

https://reviews.llvm.org/D30977

Files:
  lib/CodeGen/CGObjC.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/CodeGenModule.h
  test/CodeGenObjC/availability-cf-link-guard.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30977.91860.patch
Type: text/x-patch
Size: 4061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170315/d825800c/attachment.bin>


More information about the cfe-commits mailing list