Minor NFC cleanups

This commit is contained in:
Slava Pestov
2018-08-08 10:09:20 -07:00
parent cf664b2654
commit b67752a15f
3 changed files with 3 additions and 5 deletions

View File

@@ -2816,7 +2816,7 @@ RValue RValueEmitter::visitObjCSelectorExpr(ObjCSelectorExpr *e, SGFContext C) {
for (auto member : selectorDecl->getMembers()) {
if (auto var = dyn_cast<VarDecl>(member)) {
if (!var->isStatic() && var->hasStorage()) {
selectorMemberTy = var->getInterfaceType()->getRValueType();
selectorMemberTy = var->getInterfaceType();
break;
}
}

View File

@@ -5265,7 +5265,7 @@ bool FailureDiagnosis::diagnoseArgumentGenericRequirements(
// requirements e.g. <A, B where A.Element == B.Element>.
for (unsigned i = 0, e = bindings.size(); i != e; ++i) {
auto param = params[i];
auto paramType = param.getType()->getInOutObjectType();
auto paramType = param.getPlainType();
auto archetype = paramType->getAs<ArchetypeType>();
if (!archetype)

View File

@@ -384,9 +384,7 @@ static Type findBaseTypeForReplacingArchetype(const ValueDecl *VD, const Type Ty
return Type();
// Find the nominal type decl related to VD.
NominalTypeDecl *NTD = VD->getDeclContext()->
getAsNominalTypeOrNominalTypeExtensionContext();
if (!NTD)
if (!VD->getDeclContext()->isTypeContext())
return Type();
return Ty->getRValueType()->getRValueInstanceType();