diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-25 17:56:48 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-25 17:56:48 +0000 |
commit | 041895354a5c4280f00a86082e4218312dd44467 (patch) | |
tree | 62892891e071ae1a07ca05f02b6d44cb1c1dc874 /lib/Rewrite/RewriteModernObjC.cpp | |
parent | d80d484168c8b12f2c09fdecf43999478fcb4348 (diff) |
modern objc rewriter: fixes a bug writing
a const qualified static c-function.
// rdar://11314329
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteModernObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteModernObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteModernObjC.cpp b/lib/Rewrite/RewriteModernObjC.cpp index 9cefa5ed2d..705a046223 100644 --- a/lib/Rewrite/RewriteModernObjC.cpp +++ b/lib/Rewrite/RewriteModernObjC.cpp @@ -4133,7 +4133,9 @@ void RewriteModernObjC::SynthesizeBlockLiterals(SourceLocation FunLocStart, } void RewriteModernObjC::InsertBlockLiteralsWithinFunction(FunctionDecl *FD) { - SourceLocation FunLocStart = getFunctionSourceLocation(*this, FD); + SourceLocation FunLocStart = + (!Blocks.empty()) ? getFunctionSourceLocation(*this, FD) + : FD->getTypeSpecStartLoc(); StringRef FuncName = FD->getName(); SynthesizeBlockLiterals(FunLocStart, FuncName); |