aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-03-23 11:14:27 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-03-23 11:14:27 +0000
commita8fbef44fe2347942e2eb76e5b9144d74b5bdc7e (patch)
tree9bcd3977f509cd765829e2709c130b00fc8994fb /clang/lib/CodeGen/CodeGenModule.cpp
parent5ffe4e14f1e3476776663840af9b551caf6466c3 (diff)
downloadllvm-a8fbef44fe2347942e2eb76e5b9144d74b5bdc7e.zip
llvm-a8fbef44fe2347942e2eb76e5b9144d74b5bdc7e.tar.gz
llvm-a8fbef44fe2347942e2eb76e5b9144d74b5bdc7e.tar.bz2
[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 llvm-svn: 298588
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ca1850e..89ee7fc 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -414,6 +414,7 @@ void CodeGenModule::Release() {
CoverageMapping->emit();
if (CodeGenOpts.SanitizeCfiCrossDso)
CodeGenFunction(*this).EmitCfiCheckFail();
+ emitAtAvailableLinkGuard();
emitLLVMUsed();
if (SanStats)
SanStats->finish();