[PATCH] D19094: Nuke getGlobalContext() from LLVM (but the C API)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 08:20:20 PDT 2016


chapuni added a subscriber: chapuni.

================
Comment at: tools/lli/lli.cpp:388
@@ -387,3 +387,3 @@
 
-  LLVMContext &Context = getGlobalContext();
+  LLVMContext Context;
   atexit(do_shutdown);  // Call llvm_shutdown() on exit.
----------------
I guess it might cause undefined behavior. See do_shutdown().
It seems EE depends on LLVMContext and EE is alive after Context has been destroyed.

Appeased in r266441, or we should do;

  # Make destructors in EE to be unaware of LLVMContext.
  # Don't use return in main(), but exit().
  # Make lli not to use do_shutdown().


http://reviews.llvm.org/D19094





More information about the llvm-commits mailing list