[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified
authorCraig Topper <craig.topper@intel.com>
Wed, 8 Aug 2018 19:14:23 +0000 (19:14 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 8 Aug 2018 19:14:23 +0000 (19:14 +0000)
r330571 added a new FrontendTimesIsEnabled variable and replaced many usages of llvm::TimePassesIsEnabled. Including the place that set llvm::TimePassesIsEnabled for -ftime-report. The effect of this is that -ftime-report now only contains the timers specifically referenced in CodeGenAction.cpp and none of the timers in the backend.

This commit adds back the assignment, but otherwise leaves everything else unchanged.

llvm-svn: 339281

clang/lib/CodeGen/CodeGenAction.cpp

index d499364..1a2b061 100644 (file)
@@ -127,6 +127,7 @@ namespace clang {
                                 CodeGenOpts, C, CoverageInfo)),
           LinkModules(std::move(LinkModules)) {
       FrontendTimesIsEnabled = TimePasses;
+      llvm::TimePassesIsEnabled = TimePasses;
     }
     llvm::Module *getModule() const { return Gen->GetModule(); }
     std::unique_ptr<llvm::Module> takeModule() {