Skip to content

Commit 2f21735

Browse files
compnerdbob-wilson
authored andcommitted
adjust for SVN r286524 and SVN r287369
Groups are required for Timers after SVN r286524. SVN r287369 requires that timers have short names and long descriptions. Adjust the API usage accordingly. Reorder some words to make some more sense as a description.
1 parent 13da3fa commit 2f21735

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/swift/Basic/Timer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ namespace swift {
3333
public:
3434
explicit SharedTimer(StringRef name) {
3535
if (CompilationTimersEnabled == State::Enabled)
36-
Timer.emplace(name, StringRef("Swift compilation"));
36+
Timer.emplace(name, StringRef("Swift compilation"), StringRef("swift"),
37+
StringRef("swift related timers"));
3738
else
3839
CompilationTimersEnabled = State::Skipped;
3940
}

lib/Driver/Compilation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ int Compilation::performJobsImpl() {
438438
}
439439

440440
int Result = EXIT_SUCCESS;
441-
llvm::TimerGroup DriverTimerGroup("Driver Time Compilation");
441+
llvm::TimerGroup DriverTimerGroup("driver", "Driver Compilation Time");
442442
llvm::SmallDenseMap<const Job *, std::unique_ptr<llvm::Timer>, 16>
443443
DriverTimers;
444444

@@ -470,7 +470,7 @@ int Compilation::performJobsImpl() {
470470
DriverTimers.insert({
471471
BeganCmd,
472472
std::unique_ptr<llvm::Timer>(
473-
new llvm::Timer(OS.str(), DriverTimerGroup))
473+
new llvm::Timer("task", OS.str(), DriverTimerGroup))
474474
});
475475
DriverTimers[BeganCmd]->startTimer();
476476
}

test/Driver/driver-time-compilation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-build-swift -typecheck -driver-time-compilation %s 2>&1 | %FileCheck %s
22
// RUN: %target-build-swift -typecheck -driver-time-compilation %s %S/../Inputs/empty.swift 2>&1 | %FileCheck -check-prefix CHECK-MULTIPLE %s
33

4-
// CHECK: Driver Time Compilation
4+
// CHECK: Driver Compilation Time
55
// CHECK: Total Execution Time: {{[0-9]+}}.{{[0-9]+}} seconds ({{[0-9]+}}.{{[0-9]+}} wall clock)
66
// CHECK: ---Wall Time---
77
// CHECK: --- Name ---

0 commit comments

Comments
 (0)