diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-15 18:14:52 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-15 18:14:52 +0000 |
commit | 5c26eeefdd5748cae1ebe6df5cfcca7a007d909b (patch) | |
tree | 0d890933accc4f8750943cc83dadc307c1aac394 /clang/lib/Frontend/RewriteObjC.cpp | |
parent | 97257f8e40e242f40d50402f9ab7f2e8ceace46d (diff) | |
download | bcm5719-llvm-5c26eeefdd5748cae1ebe6df5cfcca7a007d909b.tar.gz bcm5719-llvm-5c26eeefdd5748cae1ebe6df5cfcca7a007d909b.zip |
Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096.
llvm-svn: 93519
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index fc9401d2900..386d9b0812b 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -4043,7 +4043,7 @@ std::string RewriteObjC::SynthesizeBlockDescriptor(std::string DescTag, void RewriteObjC::SynthesizeBlockLiterals(SourceLocation FunLocStart, const char *FunName) { // Insert declaration for the function in which block literal is used. - if (CurFunctionDeclToDeclareForBlock) + if (CurFunctionDeclToDeclareForBlock && !Blocks.empty()) RewriteBlockLiteralFunctionDecl(CurFunctionDeclToDeclareForBlock); // Insert closures that were part of the function. for (unsigned i = 0; i < Blocks.size(); i++) { |