[cfe-commits] r90595 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp
Steve Naroff
snaroff at apple.com
Fri Dec 4 13:18:19 PST 2009
Author: snaroff
Date: Fri Dec 4 15:18:19 2009
New Revision: 90595
URL: http://llvm.org/viewvc/llvm-project?rev=90595&view=rev
Log:
Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70922
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=90595&r1=90594&r2=90595&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Fri Dec 4 15:18:19 2009
@@ -1325,7 +1325,12 @@
// type elem;
NamedDecl* D = cast<NamedDecl>(DS->getSingleDecl());
QualType ElementType = cast<ValueDecl>(D)->getType();
- elementTypeAsString = ElementType.getAsString();
+ if (ElementType->isObjCQualifiedIdType() ||
+ ElementType->isObjCQualifiedInterfaceType())
+ // Simply use 'id' for all qualified types.
+ elementTypeAsString = "id";
+ else
+ elementTypeAsString = ElementType.getAsString();
buf += elementTypeAsString;
buf += " ";
elementName = D->getNameAsCString();
@@ -1335,8 +1340,13 @@
else {
DeclRefExpr *DR = cast<DeclRefExpr>(S->getElement());
elementName = DR->getDecl()->getNameAsCString();
- elementTypeAsString
- = cast<ValueDecl>(DR->getDecl())->getType().getAsString();
+ ValueDecl *VD = cast<ValueDecl>(DR->getDecl());
+ if (VD->getType()->isObjCQualifiedIdType() ||
+ VD->getType()->isObjCQualifiedInterfaceType())
+ // Simply use 'id' for all qualified types.
+ elementTypeAsString = "id";
+ else
+ elementTypeAsString = VD->getType().getAsString();
}
// struct __objcFastEnumerationState enumState = { 0 };
More information about the cfe-commits
mailing list