aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-09 20:41:01 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-09 20:41:01 +0000
commit13db5cfc4e5f03eb70efe0d227b53b8280f16161 (patch)
tree94795d436a9e5021d700babc08f1fcb34e0465bf /lib/CodeGen/CodeGenModule.cpp
parent88914801a4d73e321c6f74f97df7d7b11c298bc6 (diff)
Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks. Removes a terrible hack where IR gen needed to find the declarations of those symbols in the translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp90
1 files changed, 0 insertions, 90 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 7ccae08464..6df03c886f 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -2396,93 +2396,3 @@ void CodeGenModule::EmitCoverageFile() {
}
}
}
-
-///@name Custom Runtime Function Interfaces
-///@{
-//
-// FIXME: These can be eliminated once we can have clients just get the required
-// AST nodes from the builtin tables.
-
-llvm::Constant *CodeGenModule::getBlockObjectDispose() {
- if (BlockObjectDispose)
- return BlockObjectDispose;
-
- DeclarationName DName(&Context.Idents.get("_Block_object_dispose"));
- DeclContext::lookup_result
- Lookup = Context.getTranslationUnitDecl()->lookup(DName);
-
- // If there is an explicit decl, use that.
- if (Lookup.first != Lookup.second)
- if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*Lookup.first))
- return BlockObjectDispose =
- GetAddrOfFunction(FD, getTypes().GetFunctionType(FD));
-
- // Otherwise construct the function by hand.
- llvm::Type *args[] = { Int8PtrTy, Int32Ty };
- llvm::FunctionType *fty
- = llvm::FunctionType::get(VoidTy, args, false);
- return BlockObjectDispose =
- CreateRuntimeFunction(fty, "_Block_object_dispose");
-}
-
-llvm::Constant *CodeGenModule::getBlockObjectAssign() {
- if (BlockObjectAssign)
- return BlockObjectAssign;
-
- DeclarationName DName(&Context.Idents.get("_Block_object_assign"));
- DeclContext::lookup_result
- Lookup = Context.getTranslationUnitDecl()->lookup(DName);
-
- // If there is an explicit decl, use that.
- if (Lookup.first != Lookup.second)
- if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*Lookup.first))
- return BlockObjectAssign =
- GetAddrOfFunction(FD, getTypes().GetFunctionType(FD));
-
- // Otherwise construct the function by hand.
- llvm::Type *args[] = { Int8PtrTy, Int8PtrTy, Int32Ty };
- llvm::FunctionType *fty
- = llvm::FunctionType::get(VoidTy, args, false);
- return BlockObjectAssign =
- CreateRuntimeFunction(fty, "_Block_object_assign");
-}
-
-llvm::Constant *CodeGenModule::getNSConcreteGlobalBlock() {
- if (NSConcreteGlobalBlock)
- return NSConcreteGlobalBlock;
-
- DeclarationName DName(&Context.Idents.get("_NSConcreteGlobalBlock"));
- DeclContext::lookup_result
- Lookup = Context.getTranslationUnitDecl()->lookup(DName);
-
- // If there is an explicit decl, use that.
- if (Lookup.first != Lookup.second)
- if (const VarDecl *VD = dyn_cast<VarDecl>(*Lookup.first))
- return NSConcreteGlobalBlock =
- GetAddrOfGlobalVar(VD, getTypes().ConvertType(VD->getType()));
-
- // Otherwise construct the variable by hand.
- return NSConcreteGlobalBlock =
- CreateRuntimeVariable(Int8PtrTy, "_NSConcreteGlobalBlock");
-}
-
-llvm::Constant *CodeGenModule::getNSConcreteStackBlock() {
- if (NSConcreteStackBlock)
- return NSConcreteStackBlock;
-
- DeclarationName DName(&Context.Idents.get("_NSConcreteStackBlock"));
- DeclContext::lookup_result
- Lookup = Context.getTranslationUnitDecl()->lookup(DName);
-
- // If there is an explicit decl, use that.
- if (Lookup.first != Lookup.second)
- if (const VarDecl *VD = dyn_cast<VarDecl>(*Lookup.first))
- return NSConcreteStackBlock =
- GetAddrOfGlobalVar(VD, getTypes().ConvertType(VD->getType()));
-
- // Otherwise construct the variable by hand.
- return NSConcreteStackBlock =
- CreateRuntimeVariable(Int8PtrTy, "_NSConcreteStackBlock");
-}
-
-///@}