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

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 15:32:33 PDT 2016


joker.eph added a comment.

If anyone comes here looking for a fix on the client side, there is a very easy solution:

  LLVMContext &getMyLLVMGlobalContext() {
    static LLVMContext MyGlobalContext;
    return MyGlobalContext;
  }

I encourage people to avoid global mutable state in general though :)


http://reviews.llvm.org/D19094





More information about the llvm-commits mailing list