[PATCH] D81318: Add LLVM_ATTRIBUTE_NORETURN to report_bad_alloc_error

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 08:46:32 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG55c365d247b1: Add LLVM_ATTRIBUTE_NORETURN to report_bad_alloc_error (authored by aaronpuchert).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81318

Files:
  llvm/include/llvm/Support/ErrorHandling.h


Index: llvm/include/llvm/Support/ErrorHandling.h
===================================================================
--- llvm/include/llvm/Support/ErrorHandling.h
+++ llvm/include/llvm/Support/ErrorHandling.h
@@ -103,8 +103,8 @@
 
 /// Reports a bad alloc error, calling any user defined bad alloc
 /// error handler. In contrast to the generic 'report_fatal_error'
-/// functions, this function is expected to return, e.g. the user
-/// defined error handler throws an exception.
+/// functions, this function might not terminate, e.g. the user
+/// defined error handler throws an exception, but it won't return.
 ///
 /// Note: When throwing an exception in the bad alloc handler, make sure that
 /// the following unwind succeeds, e.g. do not trigger additional allocations
@@ -113,7 +113,8 @@
 /// If no error handler is installed (default), then a bad_alloc exception
 /// is thrown, if LLVM is compiled with exception support, otherwise an
 /// assertion is called.
-void report_bad_alloc_error(const char *Reason, bool GenCrashDiag = true);
+LLVM_ATTRIBUTE_NORETURN void report_bad_alloc_error(const char *Reason,
+                                                    bool GenCrashDiag = true);
 
 /// This function calls abort(), and prints the optional message to stderr.
 /// Use the llvm_unreachable macro (that adds location info), instead of


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81318.269559.patch
Type: text/x-patch
Size: 1355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200609/4712d8cf/attachment.bin>


More information about the llvm-commits mailing list