[llvm] [llvm-c] Add LLVMParseIRInContext2 (PR #174085)
Alan Hu via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 3 20:08:18 PST 2026
alan-j-hu wrote:
There is precedent to replacing the functions in the OCaml bindings, instead of adding a new function suffixed with `2`. For example, see https://github.com/llvm/llvm-project/commit/d226244ae0f5b85d21c9cd23f27f1d7890ea3b4f and https://github.com/llvm/llvm-project/commit/181ede0ebd724ff38a605fd11a5a601ed0360a16.
However, the difference is that those other functions changed their type signature, while this PR would silently change the function behavior. The API will change because now the client must free the memory buffer, but code using the function the old way won't get caught by the type checker. This is a breaking change, which is typically appropriate in major version bumps.
Would it be better to change the name of the function, e.g. to `module_of_memorybuffer`? This way, code using the function the old way would fail to compile.
https://github.com/llvm/llvm-project/pull/174085
More information about the llvm-commits
mailing list