IRBuilder has been updated to support preserving metdata in a more
general manner. This patch adds LLVMAddMetadataToInst and
deprecates LLVMSetInstDebugLocation in favor of the more
general function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems like a nice cleanup, but I think it'd be better for a current debug info maintainer to take a look.
Ping :) I just realized that I still had this follow-up to 29077ae860bc lying around. Rebased.
This is an API break to the C API, which is allowed, but is there any way we can keep the old function?
We could keep the old function and just have it call AddMetadataToInst. There should be no functional change *if* the user does not use the new functionality to collect non-debug metadata in the builder. Not sure if that's a great option. We could also extend AddMetadataToInst to accept a filter to only copy specific metadata kinds and have LLVMAddMetadataToInst use this filter. But this would also mean that we need to maintain a change IRBuilder which is only there for C API compatibility. In that case, we might as well keep the old SetInstDebugLocation. What do you think?
To me it sounds like keeping the old function would be best. We can also deprecate it in the release notes so that users are aware that it might be removed at some point, and that it might not work with the new functionality.
Sounds good, I updated the patch to only add LLVMAddMetadataToInst and deprecate LLVMAddMetadataToInst.
clang-tidy: warning: invalid case style for function 'LLVMAddMetadataToInst' [readability-identifier-naming]
not useful