From 03b42e41bf4bdd9ab05ea4c6905bae5d19971960 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 14 Apr 2016 21:59:01 +0000 Subject: 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 llvm-svn: 266379 --- llvm/examples/ExceptionDemo/ExceptionDemo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/examples/ExceptionDemo') diff --git a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp index 444ee2649fa..0afc3fdf59a 100644 --- a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1951,12 +1951,12 @@ int main(int argc, char *argv[]) { llvm::InitializeNativeTarget(); llvm::InitializeNativeTargetAsmPrinter(); - llvm::LLVMContext &context = llvm::getGlobalContext(); - llvm::IRBuilder<> theBuilder(context); + llvm::LLVMContext Context; + llvm::IRBuilder<> theBuilder(Context); // Make the module, which holds all the code. std::unique_ptr Owner = - llvm::make_unique("my cool jit", context); + llvm::make_unique("my cool jit", Context); llvm::Module *module = Owner.get(); std::unique_ptr MemMgr(new llvm::SectionMemoryManager()); -- cgit v1.2.3