[llvm] [llvm-c] Deprecate functions working on the global context (PR #163979)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 03:22:04 PDT 2025


================
@@ -581,6 +581,9 @@ LLVM_C_ABI LLVMContextRef LLVMContextCreate(void);
 
 /**
  * Obtain the global context instance.
+ *
+ * Use of the global context is deprecated. Use LLVMContextCreate() and
+ * context-aware functions instead.
  */
 LLVM_C_ABI LLVMContextRef LLVMGetGlobalContext(void);
----------------
nikic wrote:

We can handle this using a separate function in the C++ API. I've implemented this now and deprecated LLVMGetGlobalContext().

https://github.com/llvm/llvm-project/pull/163979


More information about the llvm-commits mailing list