[llvm] [llvm-c] Add LLVMParseIRInContext2 (PR #174085)

Tamir Duberstein via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 31 04:03:02 PST 2025


================
@@ -33,13 +33,29 @@ LLVM_C_EXTERN_C_BEGIN
  * Optionally returns a human-readable description of any errors that
  * occurred during parsing IR. OutMessage must be disposed with
  * LLVMDisposeMessage.
+ * Takes ownership of the memory buffer.
+ * This is deprecated. Use LLVMParseIRInContext2 instead.
  *
  * @see llvm::ParseIR()
  */
 LLVM_C_ABI LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
                                          LLVMMemoryBufferRef MemBuf,
                                          LLVMModuleRef *OutM,
                                          char **OutMessage);
+/**
+ * Read LLVM IR from a memory buffer and convert it into an in-memory Module
+ * object. Returns 0 on success.
+ * Optionally returns a human-readable description of any errors that
+ * occurred during parsing IR. OutMessage must be disposed with
+ * LLVMDisposeMessage.
+ * Does not take ownership of the memory buffer.
----------------
tamird wrote:

Done, thanks. Also took the opportunity to fix "responsibilty" typos in those other places.

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


More information about the llvm-commits mailing list