[llvm-dev] ORC JIT Weekly #32 -- Latest ORC runtime preview

Jacob Lifshay via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 12 11:17:14 PDT 2021


On Mon, Apr 12, 2021, 10:34 Lang Hames <lhames at gmail.com> wrote:

> A separate Error lib above Support? It's probably fine as is for the
>> moment, but maybe a mid-term perspective could be discussed when
>> integrating into mainline.
>
>
> I like the idea of separating ADT from libSupport and moving Error to ADT.
> If we ever did that then the ORC runtime (and other LLVM projects) could
> just use LLVM ADT. On the other hand there are some nice features that we
> can add to Error if we *do* depend on libSupport, like backtraces to the
> "throw" location when an error is dropped -- if we made Error sharable with
> compiler-rt then we'd have to give that up.
>

You wouldn't necessarily need to give up backtraces, you could have a weak
function for taking the backtrace with a default no-op implementation in
LLVM ADT, that function would be overridden by libSupport with a function
that does the actual backtrace. This is basically how backtraces are
planned on being handled in Rust's Error trait when it is moved to the core
crate, where the backtrace functionality is provided by std (which depends
on core). The only difference is they are using special rust compiler hooks
instead of weak functions.
https://github.com/rust-lang/project-error-handling/issues/3

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210412/84e7adc9/attachment.html>


More information about the llvm-dev mailing list