[llvm] [nfc] Common utility macros for `Error` / `Expect<T>` (PR #92150)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 10:30:07 PDT 2024


================
@@ -1420,6 +1420,32 @@ inline Error unwrap(LLVMErrorRef ErrRef) {
       reinterpret_cast<ErrorInfoBase *>(ErrRef)));
 }
 
+/// Common scenarios macros for handling Error or Expect<T> returns
+/// Forward Error.
+#ifndef RETURN_IF_ERROR
----------------
snehasish wrote:

I wonder if it's clearer to add an `LLVM_` prefix to these macros so that in downstream usage it's clear which macro we want for which type (e.g. llvm::Error vs absl::Status). We still want the ifndef I think just to be cautious. What do you think?

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


More information about the llvm-commits mailing list