Skip to content

Commit 16e09fc

Browse files
committed
---
yaml --- r: 345015 b: refs/heads/master c: ce8e7ac h: refs/heads/master i: 345013: e1c1808 345011: 09a6e38 345007: e7533c6
1 parent 092e0fb commit 16e09fc

22 files changed

+36
-36
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3e7e13a3ae7873ec8ae0e5090f7a5798dd866832
2+
refs/heads/master: ce8e7ac8c4f7f2a28450918f265509607c00cf74
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/AST/ASTVerifier.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,7 @@ class Verifier : public ASTWalker {
14391439
assert(knownConcreteErasure != ExistentialErasureOnly);
14401440
knownConcreteErasure = ConcreteErasureOnly;
14411441
concreteTy = concreteMeta->getInstanceType();
1442-
} else if (auto existentialMeta =
1443-
concreteTy->getAs<ExistentialMetatypeType>()) {
1442+
} else if (concreteTy->is<ExistentialMetatypeType>()) {
14441443
// If this is already forced to be a concrete erasure (say we're going
14451444
// from (P & Q).Type.Protocol to P.Type.Type), then this is invalid,
14461445
// because it would require the existential metatype to be

trunk/lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ CanType ValueDecl::getOverloadSignatureType() const {
20542054
isMethod ? 2 : 1)->getCanonicalType();
20552055
}
20562056

2057-
if (auto *asd = dyn_cast<AbstractStorageDecl>(this)) {
2057+
if (isa<AbstractStorageDecl>(this)) {
20582058
// First, get the default overload signature type for the decl. For vars,
20592059
// this is the empty tuple type, as variables cannot be overloaded directly
20602060
// by type. For subscripts, it's their interface type.
@@ -5158,7 +5158,7 @@ AbstractFunctionDecl::getObjCSelector(DeclName preferredName) const {
51585158
} else if (auto func = dyn_cast<FuncDecl>(this)) {
51595159
// Otherwise cast this to be able to access getName()
51605160
baseNameStr = func->getName().str();
5161-
} else if (auto ctor = dyn_cast<ConstructorDecl>(this)) {
5161+
} else if (isa<ConstructorDecl>(this)) {
51625162
baseNameStr = "init";
51635163
} else {
51645164
llvm_unreachable("Unknown subclass of AbstractFunctionDecl");

trunk/lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3431,7 +3431,7 @@ bool RewriteTreeNode::enumerateRulesRec(
34313431
lhs.push_back(assocType);
34323432

34333433
SWIFT_DEFER {
3434-
if (auto assocType = getMatch())
3434+
if (getMatch())
34353435
lhs.pop_back();
34363436
};
34373437

trunk/lib/AST/TypeJoinMeet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ CanType TypeJoin::visitStructType(CanType second) {
172172
assert(First != second);
173173

174174
// Deal with inout cases in visitInOutType.
175-
if (auto inoutTy = First->getAs<InOutType>())
175+
if (First->is<InOutType>())
176176
return TypeJoin(second).visit(First);
177177

178178
// FIXME: When possible we should return a protocol or protocol
@@ -233,7 +233,7 @@ CanType TypeJoin::visitBoundGenericStructType(CanType second) {
233233
assert(First != second);
234234

235235
// Deal with inout cases in visitInOutType.
236-
if (auto inoutTy = First->getAs<InOutType>())
236+
if (First->is<InOutType>())
237237
return TypeJoin(second).visit(First);
238238

239239
return Unimplemented;

trunk/lib/ClangImporter/SwiftLookupTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void SwiftLookupTable::addEntry(DeclName name, SingleEntry newEntry,
448448
auto contextOpt = translateContext(effectiveContext);
449449
if (!contextOpt) {
450450
// We might be able to resolve this later.
451-
if (auto decl = newEntry.dyn_cast<clang::NamedDecl *>()) {
451+
if (newEntry.is<clang::NamedDecl *>()) {
452452
UnresolvedEntries.push_back(
453453
std::make_tuple(name, newEntry, effectiveContext));
454454
}

trunk/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
281281
Opts.SolverShrinkUnsolvedThreshold = threshold;
282282
}
283283

284-
if (const Arg *A = Args.getLastArg(OPT_solver_disable_shrink))
284+
if (Args.getLastArg(OPT_solver_disable_shrink))
285285
Opts.SolverDisableShrink = true;
286286

287287
if (const Arg *A = Args.getLastArg(OPT_value_recursion_threshold)) {

trunk/lib/SIL/Linker.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,23 +157,26 @@ void SILLinkerVisitor::linkInVTable(ClassDecl *D) {
157157
// Visitors
158158
//===----------------------------------------------------------------------===//
159159

160+
static template<typename Inst>
161+
bool applyInstCalleeIsGeneric(Inst AI) {
162+
return AI->getCallee()->getType().template castTo<SILFunctionType>()
163+
->getGenericSignature();
164+
}
165+
160166
void SILLinkerVisitor::visitApplyInst(ApplyInst *AI) {
161-
if (auto sig = AI->getCallee()->getType().castTo<SILFunctionType>()
162-
->getGenericSignature()) {
167+
if (applyInstCalleeIsGeneric(AI)) {
163168
visitApplySubstitutions(AI->getSubstitutionMap());
164169
}
165170
}
166171

167172
void SILLinkerVisitor::visitTryApplyInst(TryApplyInst *TAI) {
168-
if (auto sig = TAI->getCallee()->getType().castTo<SILFunctionType>()
169-
->getGenericSignature()) {
173+
if (applyInstCalleeIsGeneric(TAI)) {
170174
visitApplySubstitutions(TAI->getSubstitutionMap());
171175
}
172176
}
173177

174178
void SILLinkerVisitor::visitPartialApplyInst(PartialApplyInst *PAI) {
175-
if (auto sig = PAI->getCallee()->getType().castTo<SILFunctionType>()
176-
->getGenericSignature()) {
179+
if (applyInstCalleeIsGeneric(PAI)) {
177180
visitApplySubstitutions(PAI->getSubstitutionMap());
178181
}
179182
}

trunk/lib/SIL/SILProfiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static bool canCreateProfilerForAST(ASTNode N) {
9999
assert(hasASTBeenTypeChecked(N) && "Cannot use this AST for profiling");
100100

101101
if (auto *D = N.dyn_cast<Decl *>()) {
102-
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(D))
102+
if (isa<AbstractFunctionDecl>(D))
103103
return true;
104104

105105
if (isa<TopLevelCodeDecl>(D))

trunk/lib/SILGen/SILGenApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4440,7 +4440,7 @@ RValue SILGenFunction::emitApply(ResultPlanPtr &&resultPlan,
44404440

44414441
// If there's a foreign error parameter, fill it in.
44424442
ManagedValue errorTemp;
4443-
if (auto foreignError = calleeTypeInfo.foreignError) {
4443+
if (calleeTypeInfo.foreignError) {
44444444
unsigned errorParamIndex =
44454445
calleeTypeInfo.foreignError->getErrorParameterIndex();
44464446

trunk/lib/SILGen/SILGenBridging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ SILGenFunction::emitBlockToFunc(SILLocation loc,
947947

948948
CanSILFunctionType substFnTy = thunkTy;
949949

950-
if (auto genericSig = thunkTy->getGenericSignature()) {
950+
if (thunkTy->getGenericSignature()) {
951951
substFnTy = thunkTy->substGenericArgs(F.getModule(),
952952
interfaceSubs);
953953
}

trunk/lib/SILGen/SILGenPoly.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,7 +2996,7 @@ static ManagedValue createThunk(SILGenFunction &SGF,
29962996

29972997
CanSILFunctionType substFnType = thunkType;
29982998

2999-
if (auto genericSig = thunkType->getGenericSignature()) {
2999+
if (thunkType->getGenericSignature()) {
30003000
substFnType = thunkType->substGenericArgs(SGF.F.getModule(),
30013001
interfaceSubs);
30023002
}
@@ -3105,7 +3105,7 @@ SILGenFunction::createWithoutActuallyEscapingClosure(
31053105
// Use the subsitution map in the context of the current function.
31063106
// thunk->getForwardingSubstitutionMap() / thunk might have been created in a
31073107
// different function's generic enviroment.
3108-
if (auto genericSig = thunkType->getGenericSignature()) {
3108+
if (thunkType->getGenericSignature()) {
31093109
substFnTy = thunkType->substGenericArgs(F.getModule(), interfaceSubs);
31103110
}
31113111

@@ -3716,7 +3716,7 @@ SILGenFunction::emitCanonicalFunctionThunk(SILLocation loc, ManagedValue fn,
37163716

37173717
CanSILFunctionType substFnTy = thunkTy;
37183718

3719-
if (auto genericSig = thunkTy->getGenericSignature()) {
3719+
if (thunkTy->getGenericSignature()) {
37203720
substFnTy = thunkTy->substGenericArgs(F.getModule(), interfaceSubs);
37213721
}
37223722

trunk/lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ static bool tryExtendLifetimeToLastUse(
203203
// Handle an apply.
204204
if (auto SingleApplyUser = FullApplySite::isa(SingleUser)) {
205205
// FIXME: Don't know how-to handle begin_apply/end_apply yet.
206-
if (auto *Begin =
207-
dyn_cast<BeginApplyInst>(SingleApplyUser.getInstruction())) {
206+
if (isa<BeginApplyInst>(SingleApplyUser.getInstruction())) {
208207
return false;
209208
}
210209

trunk/lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ SILInstruction *SILCombiner::visitStrongRetainInst(StrongRetainInst *SRI) {
780780
// The builtin code pattern to find tagged strings is:
781781
// builtin "stringObjectOr_Int64" (or to tag the string)
782782
// value_to_bridge_object (cast the UInt to bridge object)
783-
if (auto *VTBOI = dyn_cast<ValueToBridgeObjectInst>(SRI->getOperand())) {
783+
if (isa<ValueToBridgeObjectInst>(SRI->getOperand())) {
784784
return eraseInstFromFunction(*SRI);
785785
}
786786

@@ -1230,7 +1230,7 @@ SILInstruction *SILCombiner::visitStrongReleaseInst(StrongReleaseInst *SRI) {
12301230
// The builtin code pattern to find tagged strings is:
12311231
// builtin "stringObjectOr_Int64" (or to tag the string)
12321232
// value_to_bridge_object (cast the UInt to bridge object)
1233-
if (auto *VTBOI = dyn_cast<ValueToBridgeObjectInst>(SRI->getOperand())) {
1233+
if (isa<ValueToBridgeObjectInst>(SRI->getOperand())) {
12341234
return eraseInstFromFunction(*SRI);
12351235
}
12361236

trunk/lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ namespace {
695695
}
696696

697697
unsigned getNaturalArgumentCount(ValueDecl *member) {
698-
if (auto func = dyn_cast<AbstractFunctionDecl>(member)) {
698+
if (isa<AbstractFunctionDecl>(member)) {
699699
// For functions, close the existential once the function
700700
// has been fully applied.
701701
return 2;

trunk/lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7647,9 +7647,8 @@ bool FailureDiagnosis::visitArrayExpr(ArrayExpr *E) {
76477647
if (!DLC)
76487648
return visitExpr(E);
76497649

7650-
if (auto Conformance
7651-
= CS.TC.conformsToProtocol(contextualType, DLC, CS.DC,
7652-
ConformanceCheckFlags::InExpression)) {
7650+
if (CS.TC.conformsToProtocol(contextualType, DLC, CS.DC,
7651+
ConformanceCheckFlags::InExpression)) {
76537652
// If the contextual type conforms to ExpressibleByDictionaryLiteral and
76547653
// this is an empty array, then they meant "[:]".
76557654
auto numElements = E->getNumElements();

trunk/lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ValueDecl *RequirementFailure::getDeclRef() const {
9393
locator = cs.getConstraintLocator(
9494
ctor.withPathElement(PathEltKind::ApplyFunction)
9595
.withPathElement(PathEltKind::ConstructorMember));
96-
} else if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchor)) {
96+
} else if (isa<UnresolvedDotExpr>(anchor)) {
9797
ConstraintLocatorBuilder member(locator);
9898
locator =
9999
cs.getConstraintLocator(member.withPathElement(PathEltKind::Member));

trunk/lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ static void tryOptimizeGenericDisjunction(ConstraintSystem &cs,
14601460

14611461
auto funcType = AFD->getInterfaceType();
14621462
auto hasAnyOrOptional = funcType.findIf([](Type type) -> bool {
1463-
if (auto objType = type->getOptionalObjectType())
1463+
if (type->getOptionalObjectType())
14641464
return true;
14651465

14661466
return type->isAny();

trunk/lib/Sema/DerivedConformances.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bool DerivedConformance::derivesProtocolConformance(DeclContext *DC,
125125
}
126126

127127
// Structs can explicitly derive Equatable conformance.
128-
if (auto structDecl = dyn_cast<StructDecl>(Nominal)) {
128+
if (isa<StructDecl>(Nominal)) {
129129
switch (*knownProtocol) {
130130
case KnownProtocolKind::Equatable:
131131
return canDeriveEquatable(DC, Nominal);

trunk/lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3104,7 +3104,7 @@ Expr *TypeChecker::coerceToRValue(Expr *expr,
31043104
}
31053105

31063106
// Load lvalues.
3107-
if (auto lvalue = exprTy->getAs<LValueType>())
3107+
if (exprTy->is<LValueType>())
31083108
return addImplicitLoadExpr(expr, getType, setType);
31093109

31103110
// Walk into parenthesized expressions to update the subexpression.

trunk/lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ IsDynamicRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const {
11891189
return false;
11901190

11911191
// If 'dynamic' was explicitly specified, check it.
1192-
if (auto dynamicAttr = decl->getAttrs().getAttribute<DynamicAttr>()) {
1192+
if (decl->getAttrs().hasAttribute<DynamicAttr>()) {
11931193
return makeDynamic(decl);
11941194
}
11951195

trunk/lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ Optional<ObjCReason> shouldMarkAsObjC(const ValueDecl *VD, bool allowImplicit) {
10411041
}
10421042

10431043
// Destructors are always @objc, with -dealloc as their entry point.
1044-
if (auto deinit = dyn_cast<DestructorDecl>(VD))
1044+
if (isa<DestructorDecl>(VD))
10451045
return ObjCReason(ObjCReason::ImplicitlyObjC);
10461046

10471047
ProtocolDecl *protocolContext =

0 commit comments

Comments
 (0)