slightly simplify interface

llvm-svn: 42858
This commit is contained in:
Chris Lattner 2007-10-11 03:36:41 +00:00
parent 87c149bf51
commit f709a1495d
2 changed files with 6 additions and 9 deletions

View File

@ -627,9 +627,8 @@ QualType ASTContext::getObjcQualifiedInterfaceType(ObjcInterfaceDecl *Decl,
return QualType(QT, 0); return QualType(QT, 0);
// No Match; // No Match;
ObjcQualifiedInterfaceType *QType = new ObjcQualifiedInterfaceType(IType); ObjcQualifiedInterfaceType *QType =
for (unsigned i = 0; i != NumProtocols; i++) new ObjcQualifiedInterfaceType(IType, Protocols, NumProtocols);
QType->setProtocols(Protocols[i]);
Types.push_back(QType); Types.push_back(QType);
ObjcQualifiedInterfaceTypes.InsertNode(QType, InsertPos); ObjcQualifiedInterfaceTypes.InsertNode(QType, InsertPos);
return QualType(QType, 0); return QualType(QType, 0);

View File

@ -846,12 +846,10 @@ class ObjcQualifiedInterfaceType : public Type, public llvm::FoldingSetNode {
// List is sorted on protocol name. No protocol is enterred more than once. // List is sorted on protocol name. No protocol is enterred more than once.
llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols; llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols;
ObjcQualifiedInterfaceType(ObjcInterfaceType *T) : ObjcQualifiedInterfaceType(ObjcInterfaceType *T,
Type(ObjcQualifiedInterface, QualType()), InterfaceType(T) { } ObjcProtocolDecl **Protos, unsigned NumP) :
Type(ObjcQualifiedInterface, QualType()), InterfaceType(T),
void setProtocols(ObjcProtocolDecl *pType) { Protocols(Protos, Protos+NumP) { }
Protocols.push_back(pType);
}
friend class ASTContext; // ASTContext creates these. friend class ASTContext; // ASTContext creates these.
public: public: