[cfe-commits] r155564 - in /cfe/trunk: lib/Rewrite/RewriteModernObjC.cpp test/Rewriter/rewrite-modern-extern-c-func-decl.mm
Fariborz Jahanian
fjahanian at apple.com
Wed Apr 25 10:56:49 PDT 2012
Author: fjahanian
Date: Wed Apr 25 12:56:48 2012
New Revision: 155564
URL: http://llvm.org/viewvc/llvm-project?rev=155564&view=rev
Log:
modern objc rewriter: fixes a bug writing
a const qualified static c-function.
// rdar://11314329
Modified:
cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
cfe/trunk/test/Rewriter/rewrite-modern-extern-c-func-decl.mm
Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=155564&r1=155563&r2=155564&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Wed Apr 25 12:56:48 2012
@@ -4133,7 +4133,9 @@
}
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);
Modified: cfe/trunk/test/Rewriter/rewrite-modern-extern-c-func-decl.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-modern-extern-c-func-decl.mm?rev=155564&r1=155563&r2=155564&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-modern-extern-c-func-decl.mm (original)
+++ cfe/trunk/test/Rewriter/rewrite-modern-extern-c-func-decl.mm Wed Apr 25 12:56:48 2012
@@ -68,3 +68,5 @@
});
}
+// rdar://11314329
+static inline const void *auto_zone_base_pointer(void *zone, const void *ptr) { return 0; }
More information about the cfe-commits
mailing list