r266277 - Make sure the LLVMContext outlive the CompilerInstance

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 13 22:37:41 PDT 2016


Author: mehdi_amini
Date: Thu Apr 14 00:37:41 2016
New Revision: 266277

URL: http://llvm.org/viewvc/llvm-project?rev=266277&view=rev
Log:
Make sure the LLVMContext outlive the CompilerInstance

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    cfe/trunk/unittests/CodeGen/BufferSourceTest.cpp

Modified: cfe/trunk/unittests/CodeGen/BufferSourceTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/CodeGen/BufferSourceTest.cpp?rev=266277&r1=266276&r2=266277&view=diff
==============================================================================
--- cfe/trunk/unittests/CodeGen/BufferSourceTest.cpp (original)
+++ cfe/trunk/unittests/CodeGen/BufferSourceTest.cpp Thu Apr 14 00:37:41 2016
@@ -39,8 +39,8 @@ const char TestProgram[] =
     "EmitCXXGlobalInitFunc test;    ";
 
 TEST(BufferSourceTest, EmitCXXGlobalInitFunc) {
-    CompilerInstance compiler;
     LLVMContext Context;
+    CompilerInstance compiler;
 
     compiler.createDiagnostics();
     compiler.getLangOpts().CPlusPlus = 1;




More information about the cfe-commits mailing list