Remove every uses of getGlobalContext() in LLVM (but the C API)
At the same time, fixes InstructionsTest::CastInst unittest: yes
you can leave the IR in an invalid state and exit when you don't
destroy the context (like the global one), no longer now.
This is the first part of http://reviews.llvm.org/D19094
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266379
diff --git a/llvm/tools/llvm-split/llvm-split.cpp b/llvm/tools/llvm-split/llvm-split.cpp
index 010b1eb..0243635 100644
--- a/llvm/tools/llvm-split/llvm-split.cpp
+++ b/llvm/tools/llvm-split/llvm-split.cpp
@@ -41,7 +41,7 @@
cl::desc("Split without externalizing locals"));
int main(int argc, char **argv) {
- LLVMContext &Context = getGlobalContext();
+ LLVMContext Context;
SMDiagnostic Err;
cl::ParseCommandLineOptions(argc, argv, "LLVM module splitter\n");