<div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">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.<br><a href="https://github.com/rust-lang/project-error-handling/issues/3">https://github.com/rust-lang/project-error-handling/issues/3</a></blockquote><div><br></div><div>Oh -- That's a really good point. Maybe decoupling Error from libSupport isn't as difficult as I had assumed.</div><div><br></div><div>Thanks Jacob!</div><div><br></div><div>-- Lang. </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 12, 2021 at 11:17 AM Jacob Lifshay <<a href="mailto:programmerjake@gmail.com">programmerjake@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, Apr 12, 2021, 10:34 Lang Hames <<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> 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.</blockquote><div><br></div><div>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.</div></div></div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><a href="https://github.com/rust-lang/project-error-handling/issues/3" target="_blank">https://github.com/rust-lang/project-error-handling/issues/3</a><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
</blockquote></div></div>
</blockquote></div>