[PATCH] D90831: DebugInfo support for OCaml bindings

Vaivaswatha Nagaraj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 03:17:29 PDT 2021


vaivaswatha added a comment.

In D90831#2625375 <https://reviews.llvm.org/D90831#2625375>, @vaivaswatha wrote:

> @jberdine I have addressed all your comments, except for the one on stricter type aliases for Metadata.
>
>> Is this what you were working toward and ran into problems with?
>
> No, I only attempted something simpler along the lines of your experimental change. Nothing so much as having conversion functions between them.
>
> I need to think what's the best way to model the C++ type hierarchy for Metadata here in OCaml. For example, there is `llvalue` and `llbasicblock` already in `Llvml.ml`, but they just rely on, internally in `Core.cpp`, `cast<>` throwing a runtime error (at least that's what I understood of it).
>
>> that would optimally be implemented with something like a dyn_cast
>
> We don't have `dyn_cast` available in the C-API (I couldn't find any uses of it). So we might need to reestablish the subtyping from scratch using the `MetadataKind` enum values. I'm not sure that will be easy to maintain though. I can give it a try.

The above comment was added just before I uploaded the reworked patch, so it gets hidden by the review tool. I'm writing this so that it appears without having to "show older comments" and you don't miss it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90831/new/

https://reviews.llvm.org/D90831



More information about the llvm-commits mailing list