[llvm] [orc-rt] Add Error / Exception interop. (PR #172247)

Jared Wyles via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 14 20:35:31 PST 2025


================
@@ -127,10 +186,22 @@ class ORC_RT_NODISCARD Error {
 };
 
 /// Create an Error from an ErrorInfoBase.
-inline Error make_error(std::unique_ptr<ErrorInfoBase> Payload) {
+inline Error make_error(std::unique_ptr<ErrorInfoBase> Payload) noexcept {
   return Error(std::move(Payload));
 }
 
+#if ORC_RT_ENABLE_EXCEPTIONS
+
+template <typename ThisT, typename ParentT>
+Error ErrorExtends<ThisT, ParentT>::restoreError() noexcept {
+  return make_error(
+      std::unique_ptr<ThisT>(new ThisT(*static_cast<ThisT *>(this))));
----------------
jaredwy wrote:

make_unique? 

https://github.com/llvm/llvm-project/pull/172247


More information about the llvm-commits mailing list