Call llvm_shutdown() on (normal) termination. This makes --time-passes usable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58308 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index ac5a4b2..765c05b 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -45,6 +45,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Config/config.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/System/Host.h"
 #include "llvm/System/Path.h"
@@ -1534,5 +1535,9 @@
   if (VerifyDiagnostics)
     return 0;
 
+  // Managed static deconstruction. Useful for making things like
+  // -time-passes usable.
+  llvm::llvm_shutdown();
+
   return HadErrors || (Diags.getNumErrors() != 0);
 }