[cfe-commits] r96549 - in /cfe/trunk: lib/Frontend/RewriteObjC.cpp test/Rewriter/rewrite-block-pointer.mm
Fariborz Jahanian
fjahanian at apple.com
Wed Feb 17 17:20:22 PST 2010
Author: fjahanian
Date: Wed Feb 17 19:20:22 2010
New Revision: 96549
URL: http://llvm.org/viewvc/llvm-project?rev=96549&view=rev
Log:
__typeof should be able to handle block pointer types when
rewriting. Fixes radar 7659483.
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
cfe/trunk/test/Rewriter/rewrite-block-pointer.mm
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=96549&r1=96548&r2=96549&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Wed Feb 17 19:20:22 2010
@@ -4416,7 +4416,7 @@
const TypeOfExprType *TypeOfExprTypePtr = cast<TypeOfExprType>(TypePtr);
QT = TypeOfExprTypePtr->getUnderlyingExpr()->getType();
std::string TypeAsString = "(";
- TypeAsString += QT.getAsString();
+ RewriteBlockPointerType(TypeAsString, QT);
TypeAsString += ")";
ReplaceText(LocStart, endBuf-startBuf+1, TypeAsString);
return;
Modified: cfe/trunk/test/Rewriter/rewrite-block-pointer.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-block-pointer.mm?rev=96549&r1=96548&r2=96549&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-block-pointer.mm (original)
+++ cfe/trunk/test/Rewriter/rewrite-block-pointer.mm Wed Feb 17 19:20:22 2010
@@ -27,3 +27,9 @@
x(cmp);
});
}
+
+// radar 7659483
+void *_Block_copy(const void *aBlock);
+void x(void (^block)(void)) {
+ block = ((__typeof(block))_Block_copy((const void *)(block)));
+}
More information about the cfe-commits
mailing list