Fix bcc initialization and shutdown issues.
Actually call the correct LLVM init functions.
Change-Id: I883ebe70ae0bb4a535a9bc0536a517dab0cb3ebb
diff --git a/tools/bcc/Main.cpp b/tools/bcc/Main.cpp
index 7668b09..f1c15cc 100644
--- a/tools/bcc/Main.cpp
+++ b/tools/bcc/Main.cpp
@@ -25,6 +25,7 @@
#include <llvm/Config/config.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/Support/FileSystem.h>
+#include <llvm/Support/ManagedStatic.h>
#include <llvm/Support/MemoryBuffer.h>
#include <llvm/Support/Path.h>
#include <llvm/Support/PluginLoader.h>
@@ -198,10 +199,12 @@
}
int main(int argc, char **argv) {
+
+ llvm::llvm_shutdown_obj Y;
+ init::Initialize();
llvm::cl::SetVersionPrinter(BCCVersionPrinter);
llvm::cl::ParseCommandLineOptions(argc, argv);
std::string commandLine = bcc::getCommandLine(argc, argv);
- init::Initialize();
BCCContext context;
RSCompilerDriver RSCD;