[cfe-commits] r95257 - in /cfe/trunk: lib/Frontend/RewriteObjC.cpp test/Rewriter/rewrite-protocol-qualified.mm
Fariborz Jahanian
fjahanian at apple.com
Wed Feb 3 13:29:29 PST 2010
Author: fjahanian
Date: Wed Feb 3 15:29:28 2010
New Revision: 95257
URL: http://llvm.org/viewvc/llvm-project?rev=95257&view=rev
Log:
Fix more rewriting of protocol-quialified 'id' type.
(Fixes radar 7607413).
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
cfe/trunk/test/Rewriter/rewrite-protocol-qualified.mm
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=95257&r1=95256&r2=95257&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Wed Feb 3 15:29:28 2010
@@ -1995,6 +1995,8 @@
}
bool RewriteObjC::needToScanForQualifiers(QualType T) {
+ if (T->isObjCQualifiedIdType())
+ return true;
if (const PointerType *PT = T->getAs<PointerType>()) {
if (PT->getPointeeType()->isObjCQualifiedIdType())
return true;
Modified: cfe/trunk/test/Rewriter/rewrite-protocol-qualified.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-protocol-qualified.mm?rev=95257&r1=95256&r2=95257&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-protocol-qualified.mm (original)
+++ cfe/trunk/test/Rewriter/rewrite-protocol-qualified.mm Wed Feb 3 15:29:28 2010
@@ -16,6 +16,26 @@
}
@end
+// radar 7607413
+ at protocol Proto1, Proto2;
+
+ at protocol Proto
+ at end
+
+unsigned char func(id<Proto1, Proto2> inProxy);
+
+id bar(id);
+
+void f() {
+ id a;
+ id b = bar((id <Proto>)a);
+}
+
// CHECK-LP: NSConnection /*<NSPortDelegate>*/ *conn = 0;
// CHECK-LP: id /*<NSPortDelegate>*/ *idc = 0;
+
+// CHECK-LP: func(id/*<Proto1, Proto2>*/ inProxy);
+
+// CHECK-LP: bar((id /*<Proto>*/)a);
+
More information about the cfe-commits
mailing list