[cfe-commits] r60887 - /cfe/trunk/Driver/RewriteObjC.cpp
Steve Naroff
snaroff at apple.com
Thu Dec 11 11:29:35 PST 2008
Author: snaroff
Date: Thu Dec 11 13:29:16 2008
New Revision: 60887
URL: http://llvm.org/viewvc/llvm-project?rev=60887&view=rev
Log:
Fix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks don't work together
Modified:
cfe/trunk/Driver/RewriteObjC.cpp
Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=60887&r1=60886&r2=60887&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Thu Dec 11 13:29:16 2008
@@ -720,7 +720,7 @@
// attributes (copy, retain, nonatomic).
// See objc-act.c:objc_synthesize_new_setter() for details.
Setr += getIvarAccessString(ClassDecl, OID) + " = ";
- Setr += OID->getNameAsCString();
+ Setr += PD->getNameAsCString();
Setr += "; }";
InsertText(onePastSemiLoc, Setr.c_str(), Setr.size());
@@ -861,16 +861,19 @@
ResultStr += "\nstatic ";
if (OMD->getResultType()->isObjCQualifiedIdType())
ResultStr += "id";
- else if (OMD->getResultType()->isFunctionPointerType()) {
+ else if (OMD->getResultType()->isFunctionPointerType() ||
+ OMD->getResultType()->isBlockPointerType()) {
// needs special handling, since pointer-to-functions have special
// syntax (where a decaration models use).
QualType retType = OMD->getResultType();
- if (const PointerType* PT = retType->getAsPointerType()) {
- QualType PointeeTy = PT->getPointeeType();
- if ((FPRetType = PointeeTy->getAsFunctionType())) {
- ResultStr += FPRetType->getResultType().getAsString();
- ResultStr += "(*";
- }
+ QualType PointeeTy;
+ if (const PointerType* PT = retType->getAsPointerType())
+ PointeeTy = PT->getPointeeType();
+ else if (const BlockPointerType *BPT = retType->getAsBlockPointerType())
+ PointeeTy = BPT->getPointeeType();
+ if ((FPRetType = PointeeTy->getAsFunctionType())) {
+ ResultStr += FPRetType->getResultType().getAsString();
+ ResultStr += "(*";
}
} else
ResultStr += OMD->getResultType().getAsString();
More information about the cfe-commits
mailing list