]> granicus.if.org Git - clang/commitdiff
modern objc rewriter: fixes a bug writing
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 25 Apr 2012 17:56:48 +0000 (17:56 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 25 Apr 2012 17:56:48 +0000 (17:56 +0000)
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

lib/Rewrite/RewriteModernObjC.cpp
test/Rewriter/rewrite-modern-extern-c-func-decl.mm

index 9cefa5ed2d76581240715fdfad79d1cfcac578a7..705a046223030ccf61e1cb058c0654cb28a9c022 100644 (file)
@@ -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);
index 1c8fbfbca4e0c87a7707e5fe77ed55a01ccd8991..590a4d4346f0bd7b839a48a13147ce67f02c47a0 100644 (file)
@@ -68,3 +68,5 @@ static void initStatics2() {
     });
 }
 
+// rdar://11314329
+static inline const void *auto_zone_base_pointer(void *zone, const void *ptr) { return 0; }