diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-10-08 20:26:34 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-10-08 20:26:34 +0000 |
commit | aec6b2c20e4850f2309042e46dec63e46b383fbd (patch) | |
tree | f10152e47c1fc6a470865f0d11f2a0ab8b032cac /clang/lib/CodeGen/CGBlocks.cpp | |
parent | ab2241f1b83aaa55944a257e5271bfc3d8a14715 (diff) | |
download | bcm5719-llvm-aec6b2c20e4850f2309042e46dec63e46b383fbd.tar.gz bcm5719-llvm-aec6b2c20e4850f2309042e46dec63e46b383fbd.zip |
[CodeGen] [CodeGen] Attach function attributes to functions created in
CGBlocks.cpp.
This commit fixes a bug in clang's code-gen where it creates the
following functions but doesn't attach function attributes to them:
__copy_helper_block_
__destroy_helper_block_
__Block_byref_object_copy_
__Block_byref_object_dispose_
rdar://problem/20828324
Differential Revision: http://reviews.llvm.org/D13525
llvm-svn: 249735
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 7644ab9beee..cfb09e72c7b 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -1345,6 +1345,9 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) { nullptr, SC_Static, false, false); + + CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); + auto NL = ApplyDebugLocation::CreateEmpty(*this); StartFunction(FD, C.VoidTy, Fn, FI, args); // Create a scope with an artificial location for the body of this function. @@ -1516,6 +1519,9 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) { SourceLocation(), II, C.VoidTy, nullptr, SC_Static, false, false); + + CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); + // Create a scope with an artificial location for the body of this function. auto NL = ApplyDebugLocation::CreateEmpty(*this); StartFunction(FD, C.VoidTy, Fn, FI, args); @@ -1798,6 +1804,8 @@ generateByrefCopyHelper(CodeGenFunction &CGF, const BlockByrefInfo &byrefInfo, SC_Static, false, false); + CGF.CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); + CGF.StartFunction(FD, R, Fn, FI, args); if (generator.needsCopy()) { @@ -1869,6 +1877,9 @@ generateByrefDisposeHelper(CodeGenFunction &CGF, SourceLocation(), II, R, nullptr, SC_Static, false, false); + + CGF.CGM.SetInternalFunctionAttributes(nullptr, Fn, FI); + CGF.StartFunction(FD, R, Fn, FI, args); if (generator.needsDispose()) { |