summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2019-09-18 00:05:45 +0000
committerVolodymyr Sapsai <vsapsai@apple.com>2019-09-18 00:05:45 +0000
commit6e353b4df3aa452ed4741a5e5caea02b1a876d8c (patch)
treea939b059af98aa381cf979fda000e22e6152c7a9 /clang
parentabb3d13778f7a93ae43f6fe906a06923e93a3350 (diff)
downloadbcm5719-llvm-6e353b4df3aa452ed4741a5e5caea02b1a876d8c.tar.gz
bcm5719-llvm-6e353b4df3aa452ed4741a5e5caea02b1a876d8c.zip
[Timers] Fix printing some `-ftime-report` sections twice. Fixes PR40328.
Starting from r324788 timer groups aren't cleared automatically when printed out. As a result some timer groups were printed one more time. For example, "Pass execution timing report" was printed again in `ManagedStatic<PassTimingInfo>` destructor, "DWARF Emission" in `ManagedStatic<Name2PairMap> NamedGroupedTimers` destructor. Fix by clearing timer groups manually. Reviewers: thegameg, george.karpenkov Reviewed By: thegameg Subscribers: aprantl, jkorous, dexonsmith, ributzka, aras-p, cfe-commits Differential Revision: https://reviews.llvm.org/D67683 llvm-svn: 372191
Diffstat (limited to 'clang')
-rw-r--r--clang/tools/driver/cc1_main.cpp1
-rw-r--r--clang/tools/driver/cc1as_main.cpp1
-rw-r--r--clang/tools/driver/driver.cpp1
3 files changed, 3 insertions, 0 deletions
diff --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp
index 29767b880b6..9ed15f51b11 100644
--- a/clang/tools/driver/cc1_main.cpp
+++ b/clang/tools/driver/cc1_main.cpp
@@ -253,6 +253,7 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
+ llvm::TimerGroup::clearAll();
if (llvm::timeTraceProfilerEnabled()) {
SmallString<128> Path(Clang->getFrontendOpts().OutputFile);
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index fbeea0dd3b0..ae58a95f36f 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -609,6 +609,7 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
// If any timers were active but haven't been destroyed yet, print their
// results now.
TimerGroup::printAll(errs());
+ TimerGroup::clearAll();
return !!Failed;
}
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index eebc8920fe0..f1600490017 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -499,6 +499,7 @@ int main(int argc_, const char **argv_) {
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
+ llvm::TimerGroup::clearAll();
#ifdef _WIN32
// Exit status should not be negative on Win32, unless abnormal termination.
OpenPOWER on IntegriCloud