summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-12-08 02:47:58 +0000
committerVedant Kumar <vsk@apple.com>2017-12-08 02:47:58 +0000
commit29477dc82e9f6e35a91210daa834c59d8216d308 (patch)
tree1b95f455d5c3a83dc3886ed5d33a02b4252dcc69 /clang/lib/CodeGen/CGBlocks.cpp
parent1c30924420199897009723aa637219576bbf96fc (diff)
downloadbcm5719-llvm-29477dc82e9f6e35a91210daa834c59d8216d308.tar.gz
bcm5719-llvm-29477dc82e9f6e35a91210daa834c59d8216d308.zip
[Blocks] Inherit sanitizer options from parent decl
There is no way to apply sanitizer suppressions to ObjC blocks. A reasonable default is to have blocks inherit their parent's sanitizer options. rdar://32769634 Differential Revision: https://reviews.llvm.org/D40668 llvm-svn: 320132
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 850681471df..5f73d4cf791 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -784,7 +784,9 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo,
8);
// Using the computed layout, generate the actual block function.
bool isLambdaConv = blockInfo.getBlockDecl()->isConversionFromLambda();
- auto *InvokeFn = CodeGenFunction(CGM, true).GenerateBlockFunction(
+ CodeGenFunction BlockCGF{CGM, true};
+ BlockCGF.SanOpts = SanOpts;
+ auto *InvokeFn = BlockCGF.GenerateBlockFunction(
CurGD, blockInfo, LocalDeclMap, isLambdaConv, blockInfo.CanBeGlobal);
if (InvokeF)
*InvokeF = InvokeFn;
OpenPOWER on IntegriCloud