Deleted Added
full compact
ASTContext.cpp (204643) ASTContext.cpp (204793)
1//===--- ASTContext.cpp - Context to hold long-lived AST nodes ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 2226 unchanged lines hidden (view full) ---

2235 ProtocolsEnd = std::unique(Protocols, ProtocolsEnd);
2236 NumProtocols = ProtocolsEnd-Protocols;
2237}
2238
2239/// getObjCObjectPointerType - Return a ObjCObjectPointerType type for
2240/// the given interface decl and the conforming protocol list.
2241QualType ASTContext::getObjCObjectPointerType(QualType InterfaceT,
2242 ObjCProtocolDecl **Protocols,
1//===--- ASTContext.cpp - Context to hold long-lived AST nodes ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 2226 unchanged lines hidden (view full) ---

2235 ProtocolsEnd = std::unique(Protocols, ProtocolsEnd);
2236 NumProtocols = ProtocolsEnd-Protocols;
2237}
2238
2239/// getObjCObjectPointerType - Return a ObjCObjectPointerType type for
2240/// the given interface decl and the conforming protocol list.
2241QualType ASTContext::getObjCObjectPointerType(QualType InterfaceT,
2242 ObjCProtocolDecl **Protocols,
2243 unsigned NumProtocols) {
2243 unsigned NumProtocols,
2244 unsigned Quals) {
2244 llvm::FoldingSetNodeID ID;
2245 ObjCObjectPointerType::Profile(ID, InterfaceT, Protocols, NumProtocols);
2245 llvm::FoldingSetNodeID ID;
2246 ObjCObjectPointerType::Profile(ID, InterfaceT, Protocols, NumProtocols);
2247 Qualifiers Qs = Qualifiers::fromCVRMask(Quals);
2246
2247 void *InsertPos = 0;
2248 if (ObjCObjectPointerType *QT =
2249 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2248
2249 void *InsertPos = 0;
2250 if (ObjCObjectPointerType *QT =
2251 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2250 return QualType(QT, 0);
2252 return getQualifiedType(QualType(QT, 0), Qs);
2251
2252 // Sort the protocol list alphabetically to canonicalize it.
2253 QualType Canonical;
2254 if (!InterfaceT.isCanonical() ||
2255 !areSortedAndUniqued(Protocols, NumProtocols)) {
2256 if (!areSortedAndUniqued(Protocols, NumProtocols)) {
2257 llvm::SmallVector<ObjCProtocolDecl*, 8> Sorted(NumProtocols);
2258 unsigned UniqueCount = NumProtocols;

--- 18 unchanged lines hidden (view full) ---

2277 void *Mem = Allocate(Size, TypeAlignment);
2278 ObjCObjectPointerType *QType = new (Mem) ObjCObjectPointerType(Canonical,
2279 InterfaceT,
2280 Protocols,
2281 NumProtocols);
2282
2283 Types.push_back(QType);
2284 ObjCObjectPointerTypes.InsertNode(QType, InsertPos);
2253
2254 // Sort the protocol list alphabetically to canonicalize it.
2255 QualType Canonical;
2256 if (!InterfaceT.isCanonical() ||
2257 !areSortedAndUniqued(Protocols, NumProtocols)) {
2258 if (!areSortedAndUniqued(Protocols, NumProtocols)) {
2259 llvm::SmallVector<ObjCProtocolDecl*, 8> Sorted(NumProtocols);
2260 unsigned UniqueCount = NumProtocols;

--- 18 unchanged lines hidden (view full) ---

2279 void *Mem = Allocate(Size, TypeAlignment);
2280 ObjCObjectPointerType *QType = new (Mem) ObjCObjectPointerType(Canonical,
2281 InterfaceT,
2282 Protocols,
2283 NumProtocols);
2284
2285 Types.push_back(QType);
2286 ObjCObjectPointerTypes.InsertNode(QType, InsertPos);
2285 return QualType(QType, 0);
2287 return getQualifiedType(QualType(QType, 0), Qs);
2286}
2287
2288/// getObjCInterfaceType - Return the unique reference to the type for the
2289/// specified ObjC interface decl. The list of protocols is optional.
2290QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
2291 ObjCProtocolDecl **Protocols, unsigned NumProtocols) {
2292 llvm::FoldingSetNodeID ID;
2293 ObjCInterfaceType::Profile(ID, Decl, Protocols, NumProtocols);

--- 2845 unchanged lines hidden ---
2288}
2289
2290/// getObjCInterfaceType - Return the unique reference to the type for the
2291/// specified ObjC interface decl. The list of protocols is optional.
2292QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
2293 ObjCProtocolDecl **Protocols, unsigned NumProtocols) {
2294 llvm::FoldingSetNodeID ID;
2295 ObjCInterfaceType::Profile(ID, Decl, Protocols, NumProtocols);

--- 2845 unchanged lines hidden ---