Skip to content

Commit aa417c3

Browse files
authored
Merge pull request #29793 from slavapestov/small-misc-cleanups
Small miscellaneous cleanups
2 parents 648b589 + 06855f7 commit aa417c3

File tree

6 files changed

+9
-21
lines changed

6 files changed

+9
-21
lines changed

include/swift/Basic/Statistics.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ FRONTEND_STATISTIC(Sema, NumAccessorsSynthesized)
224224
/// Number of synthesized accessor bodies.
225225
FRONTEND_STATISTIC(Sema, NumAccessorBodiesSynthesized)
226226

227-
/// Number of full function bodies typechecked.
228-
FRONTEND_STATISTIC(Sema, NumFunctionsTypechecked)
229-
230227
/// Number of generic signature builders constructed. Rough proxy for
231228
/// amount of work the GSB does analyzing type signatures.
232229
FRONTEND_STATISTIC(Sema, NumGenericSignatureBuilders)

lib/SILGen/SILGenType.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,17 @@ class SILGenVTable : public SILVTableVisitor<SILGenVTable> {
277277
IsSerialized_t serialized = IsNotSerialized;
278278
auto classIsPublic = theClass->getEffectiveAccess() >= AccessLevel::Public;
279279
// Only public, fixed-layout classes should have serialized vtables.
280-
if (classIsPublic && !theClass->isResilient())
280+
if (classIsPublic && !isResilient)
281281
serialized = IsSerialized;
282282

283283
// Finally, create the vtable.
284284
SILVTable::create(SGM.M, theClass, serialized, vtableEntries);
285285
}
286286

287287
void visitAncestor(ClassDecl *ancestor) {
288-
auto superTy = ancestor->getSuperclass();
289-
if (superTy)
290-
visitAncestor(superTy->getClassOrBoundGenericClass());
288+
auto *superDecl = ancestor->getSuperclassDecl();
289+
if (superDecl)
290+
visitAncestor(superDecl);
291291

292292
addVTableEntries(ancestor);
293293
}

lib/Sema/TypeCheckStmt.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,15 +1932,6 @@ TypeCheckFunctionBodyUntilRequest::evaluate(Evaluator &evaluator,
19321932
SourceLoc endTypeCheckLoc) const {
19331933
ASTContext &ctx = AFD->getASTContext();
19341934

1935-
// Accounting for type checking of function bodies.
1936-
// FIXME: We could probably take this away, given that the request-evaluator
1937-
// does much of it for us.
1938-
FrontendStatsTracer StatsTracer(ctx.Stats, "typecheck-fn", AFD);
1939-
PrettyStackTraceDecl StackEntry("type-checking", AFD);
1940-
1941-
if (ctx.Stats)
1942-
ctx.Stats->getFrontendCounters().NumFunctionsTypechecked++;
1943-
19441935
Optional<FunctionBodyTimer> timer;
19451936
const auto &tyOpts = ctx.TypeCheckerOpts;
19461937
if (tyOpts.DebugTimeFunctionBodies || tyOpts.WarnLongFunctionBodies)

test/Misc/stats_dir_profiler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %t/stats-entities/*.dir/Time.User.entities %s
88

99
// EVENTS: {{perform-sema;.*;typecheck-decl.* [0-9]+}}
10-
// ENTITIES: {{perform-sema;.*;typecheck-fn bar\(\);typecheck-stmt.* [0-9]+}}
10+
// ENTITIES: {{perform-sema;.*;TypeCheckFunctionBodyUntilRequest bar\(\);typecheck-stmt.* [0-9]+}}
1111

1212
public func foo() {
1313
print("hello")

test/SILGen/subclass_existentials.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ func archetypeUpcasts<T,
295295
BaseTAndP : Base<T> & P,
296296
BaseIntAndP : Base<Int> & P,
297297
DerivedT : Derived>(
298-
baseTAndP: BaseTAndP,
299-
baseIntAndP : BaseIntAndP,
300-
derived : DerivedT) {
298+
baseTAndP: BaseTAndP,
299+
baseIntAndP : BaseIntAndP,
300+
derived : DerivedT) {
301301
// CHECK: bb0([[ARG0:%.*]] : @guaranteed $BaseTAndP, [[ARG1:%.*]] : @guaranteed $BaseIntAndP, [[ARG2:%.*]] : @guaranteed $DerivedT)
302302
// CHECK: [[COPIED:%.*]] = copy_value [[ARG0]] : $BaseTAndP
303303
// CHECK-NEXT: init_existential_ref [[COPIED]] : $BaseTAndP : $BaseTAndP, $Base<T> & P

validation-test/compiler_scale/scale_neighbouring_getset.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %scale-test --sum-multi --begin 5 --end 16 --step 5 --select NumFunctionsTypechecked %s
1+
// RUN: %scale-test --sum-multi --begin 5 --end 16 --step 5 --select TypeCheckFunctionBodyUntilRequest %s
22
// REQUIRES: asserts
33

44
struct Struct${N} {

0 commit comments

Comments
 (0)