]> granicus.if.org Git - clang/commit
[CodeGen] Emit a CoreFoundation link guard when @available is used
authorAlex Lorenz <arphaman@gmail.com>
Thu, 23 Mar 2017 11:14:27 +0000 (11:14 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Thu, 23 Mar 2017 11:14:27 +0000 (11:14 +0000)
commit50a59090a4e5ed73761a8aafb8ea2597775cf8fe
tree6aaa202f1ad1654b5687828ba2cd330feb1aee07
parent942d4ddd5316a1bb4dcfba6e6710a7747cd62e46
[CodeGen] Emit a CoreFoundation link guard when @available is used

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 commit 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.

rdar://31039592

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298588 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenObjC/availability-cf-link-guard.m [new file with mode: 0644]