gold plugin: call llvm_shutdown so that -stats works.
[oota-llvm.git] / tools / gold / gold-plugin.cpp
index 6d9d6a29d2cfc2138059a85210c98b83b0f8b2be..b7d8c5e14c688ee3fc350a992742aa41cba3b79a 100644 (file)
@@ -28,6 +28,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Host.h"
+#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetSelect.h"
@@ -838,6 +839,8 @@ static ld_plugin_status all_symbols_read_hook(void) {
     Ret = allSymbolsReadHook(&ApiFile);
   }
 
+  llvm_shutdown();
+
   if (options::TheOutputType == options::OT_BC_ONLY ||
       options::TheOutputType == options::OT_DISABLE)
     exit(0);