summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-15 11:32:37 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-15 11:32:37 +0000
commit8b07ec253d4042f824dccec711e17fb6d92bed5e (patch)
treea8983adf6d01605181cab33ce1beef16e0804609 /clang/lib/Sema/SemaCodeComplete.cpp
parent75142e6bfc4c61856ef2ede261be82efe27ab403 (diff)
downloadbcm5719-llvm-8b07ec253d4042f824dccec711e17fb6d92bed5e.tar.gz
bcm5719-llvm-8b07ec253d4042f824dccec711e17fb6d92bed5e.zip
Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 77bf91946c2..036ae7e8690 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -2047,14 +2047,14 @@ void Sema::CodeCompleteMemberReferenceExpr(Scope *S, ExprTy *BaseE,
I != E; ++I)
AddObjCProperties(*I, true, CurContext, Results);
} else if ((IsArrow && BaseType->isObjCObjectPointerType()) ||
- (!IsArrow && BaseType->isObjCInterfaceType())) {
+ (!IsArrow && BaseType->isObjCObjectType())) {
// Objective-C instance variable access.
ObjCInterfaceDecl *Class = 0;
if (const ObjCObjectPointerType *ObjCPtr
= BaseType->getAs<ObjCObjectPointerType>())
Class = ObjCPtr->getInterfaceDecl();
else
- Class = BaseType->getAs<ObjCInterfaceType>()->getDecl();
+ Class = BaseType->getAs<ObjCObjectType>()->getInterface();
// Add all ivars from this class and its superclasses.
if (Class) {
@@ -2911,9 +2911,9 @@ static ObjCInterfaceDecl *GetAssumedMessageSendExprType(Expr *E) {
ObjCInterfaceDecl *IFace = 0;
switch (Msg->getReceiverKind()) {
case ObjCMessageExpr::Class:
- if (const ObjCInterfaceType *IFaceType
- = Msg->getClassReceiver()->getAs<ObjCInterfaceType>())
- IFace = IFaceType->getDecl();
+ if (const ObjCObjectType *ObjType
+ = Msg->getClassReceiver()->getAs<ObjCObjectType>())
+ IFace = ObjType->getInterface();
break;
case ObjCMessageExpr::Instance: {
@@ -2994,9 +2994,9 @@ void Sema::CodeCompleteObjCSuperMessage(Scope *S, SourceLocation SuperLoc,
if ((CDecl = dyn_cast_or_null<ObjCInterfaceDecl>(ND))) {
// "super" names an interface. Use it.
} else if (TypeDecl *TD = dyn_cast_or_null<TypeDecl>(ND)) {
- if (const ObjCInterfaceType *Iface
- = Context.getTypeDeclType(TD)->getAs<ObjCInterfaceType>())
- CDecl = Iface->getDecl();
+ if (const ObjCObjectType *Iface
+ = Context.getTypeDeclType(TD)->getAs<ObjCObjectType>())
+ CDecl = Iface->getInterface();
} else if (ND && isa<UnresolvedUsingTypenameDecl>(ND)) {
// "super" names an unresolved type; we can't be more specific.
} else {
@@ -3030,8 +3030,8 @@ void Sema::CodeCompleteObjCClassMessage(Scope *S, TypeTy *Receiver,
if (Receiver) {
QualType T = GetTypeFromParser(Receiver, 0);
if (!T.isNull())
- if (const ObjCInterfaceType *Interface = T->getAs<ObjCInterfaceType>())
- CDecl = Interface->getDecl();
+ if (const ObjCObjectType *Interface = T->getAs<ObjCObjectType>())
+ CDecl = Interface->getInterface();
}
// Add all of the factory methods in this Objective-C class, its protocols,
OpenPOWER on IntegriCloud