Skip to content

Commit b95d4c3

Browse files
committed
[ObjC] Remove default parameter no caller was providing. NFC intended.
Currently there is no need to make ObjCTypeParamType have a canonical type different from the one in corresponding ObjCTypeParamDecl. So remove the corresponding unused API. llvm-svn: 374596
1 parent 49036dd commit b95d4c3

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

clang/include/clang/AST/ASTContext.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
15031503
bool isKindOf) const;
15041504

15051505
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl,
1506-
ArrayRef<ObjCProtocolDecl *> protocols,
1507-
QualType Canonical = QualType()) const;
1506+
ArrayRef<ObjCProtocolDecl *> protocols) const;
15081507

15091508
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl);
15101509

clang/lib/AST/ASTContext.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,8 +4714,7 @@ ASTContext::applyObjCProtocolQualifiers(QualType type,
47144714

47154715
QualType
47164716
ASTContext::getObjCTypeParamType(const ObjCTypeParamDecl *Decl,
4717-
ArrayRef<ObjCProtocolDecl *> protocols,
4718-
QualType Canonical) const {
4717+
ArrayRef<ObjCProtocolDecl *> protocols) const {
47194718
// Look in the folding set for an existing type.
47204719
llvm::FoldingSetNodeID ID;
47214720
ObjCTypeParamType::Profile(ID, Decl, protocols);
@@ -4724,16 +4723,14 @@ ASTContext::getObjCTypeParamType(const ObjCTypeParamDecl *Decl,
47244723
ObjCTypeParamTypes.FindNodeOrInsertPos(ID, InsertPos))
47254724
return QualType(TypeParam, 0);
47264725

4727-
if (Canonical.isNull()) {
4728-
// We canonicalize to the underlying type.
4729-
Canonical = getCanonicalType(Decl->getUnderlyingType());
4730-
if (!protocols.empty()) {
4731-
// Apply the protocol qualifers.
4732-
bool hasError;
4733-
Canonical = getCanonicalType(applyObjCProtocolQualifiers(
4734-
Canonical, protocols, hasError, true /*allowOnPointerType*/));
4735-
assert(!hasError && "Error when apply protocol qualifier to bound type");
4736-
}
4726+
// We canonicalize to the underlying type.
4727+
QualType Canonical = getCanonicalType(Decl->getUnderlyingType());
4728+
if (!protocols.empty()) {
4729+
// Apply the protocol qualifers.
4730+
bool hasError;
4731+
Canonical = getCanonicalType(applyObjCProtocolQualifiers(
4732+
Canonical, protocols, hasError, true /*allowOnPointerType*/));
4733+
assert(!hasError && "Error when apply protocol qualifier to bound type");
47374734
}
47384735

47394736
unsigned size = sizeof(ObjCTypeParamType);

0 commit comments

Comments
 (0)