[llvm] r330341 - [gold/ThinLTO] Invoke llvm_shutdown when exiting after ThinLTO indexing

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 09:55:13 PDT 2018


Author: tejohnson
Date: Thu Apr 19 09:55:13 2018
New Revision: 330341

URL: http://llvm.org/viewvc/llvm-project?rev=330341&view=rev
Log:
[gold/ThinLTO] Invoke llvm_shutdown when exiting after ThinLTO indexing

Summary:
Instead of manually invoking PrintStatistics, simply invoke
llvm_shutdown which will take care of destroying managed statics, and as
a side effect will destroy the StatisticInfo ManagedStatic, invoking
PrintStatistics when needed.

Reviewers: fhahn

Subscribers: inglorion, llvm-commits

Differential Revision: https://reviews.llvm.org/D45820

Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=330341&r1=330340&r2=330341&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Thu Apr 19 09:55:13 2018
@@ -1061,8 +1061,7 @@ static ld_plugin_status allSymbolsReadHo
     return LDPS_OK;
 
   if (options::thinlto_index_only) {
-    if (llvm::AreStatisticsEnabled())
-      llvm::PrintStatistics();
+    llvm_shutdown();
     cleanup_hook();
     exit(0);
   }




More information about the llvm-commits mailing list