[llvm] [RemoveDIs] Add a 'BeforeDbgRecords' parameter to C API isnt insertion functions (PR #92417)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 01:31:29 PDT 2024
OCHyams wrote:
Thanks for taking a look @nikic
> It is not possible to change the signature of a function in the C API. You can only add a new function with the new signature.
Oh, I can't see this rule in the [developer policy](https://llvm.org/docs/DeveloperPolicy.html#c-api-changes). But that would make the changes more stable.
> The usual pattern would be to add LLVMPositionBuilder2 (in this case an alternative would be to add a new function with the parameter set to the non-default value).
The reason we need to modify the API is that at the moment it's possible to insert PHIs after debug records which is illegal and leads to an assertion. I chose to modify existing functions because I figured would help reduce nasty surprises, but if stability is preferable this isn't the right tactic.
We could add new functions with the extra parameter, keep the existing functions untouched and forward args and a "default" value for the new parameter to the new functions (possibly this is what you're suggesting already)? I guess this would be most "stable" (and I think then we can omit most of the OCaml changes then).
I wonder if some of the other changes we made need re-reviewing in this case:
https://github.com/llvm/llvm-project/pull/84915 - adds some new functions (I imagine this patch is fine)
https://github.com/llvm/llvm-project/pull/85657 - changes return value of existing function (is this one ok?)
https://github.com/llvm/llvm-project/pull/92417
More information about the llvm-commits
mailing list