@@ -68,58 +68,58 @@ namespace llvm {
6868// / After the error handler is called this function will call abort(), it
6969// / does not return.
7070// / NOTE: The std::string variant was removed to avoid a <string> dependency.
71- [[noreturn]] void report_fatal_error (const char *reason,
72- bool gen_crash_diag = true );
73- [[noreturn]] void report_fatal_error (StringRef reason,
74- bool gen_crash_diag = true );
75- [[noreturn]] void report_fatal_error (const Twine &reason,
76- bool gen_crash_diag = true );
77-
78- // / Installs a new bad alloc error handler that should be used whenever a
79- // / bad alloc error, e.g. failing malloc/calloc, is encountered by LLVM.
80- // /
81- // / The user can install a bad alloc handler, in order to define the behavior
82- // / in case of failing allocations, e.g. throwing an exception. Note that this
83- // / handler must not trigger any additional allocations itself.
84- // /
85- // / If no error handler is installed the default is to print the error message
86- // / to stderr, and call exit(1). If an error handler is installed then it is
87- // / the handler's responsibility to log the message, it will no longer be
88- // / printed to stderr. If the error handler returns, then exit(1) will be
89- // / called.
90- // /
91- // /
92- // / \param user_data - An argument which will be passed to the installed error
93- // / handler.
94- void install_bad_alloc_error_handler (fatal_error_handler_t handler,
95- void *user_data = nullptr );
71+ [[noreturn]] void report_fatal_error (const char *reason,
72+ bool gen_crash_diag = false );
73+ [[noreturn]] void report_fatal_error (StringRef reason,
74+ bool gen_crash_diag = false );
75+ [[noreturn]] void report_fatal_error (const Twine &reason,
76+ bool gen_crash_diag = false );
77+
78+ // / Installs a new bad alloc error handler that should be used whenever a
79+ // / bad alloc error, e.g. failing malloc/calloc, is encountered by LLVM.
80+ // /
81+ // / The user can install a bad alloc handler, in order to define the behavior
82+ // / in case of failing allocations, e.g. throwing an exception. Note that this
83+ // / handler must not trigger any additional allocations itself.
84+ // /
85+ // / If no error handler is installed the default is to print the error message
86+ // / to stderr, and call exit(1). If an error handler is installed then it is
87+ // / the handler's responsibility to log the message, it will no longer be
88+ // / printed to stderr. If the error handler returns, then exit(1) will be
89+ // / called.
90+ // /
91+ // /
92+ // / \param user_data - An argument which will be passed to the installed error
93+ // / handler.
94+ void install_bad_alloc_error_handler (fatal_error_handler_t handler,
95+ void *user_data = nullptr );
9696
97- // / Restores default bad alloc error handling behavior.
98- void remove_bad_alloc_error_handler ();
97+ // / Restores default bad alloc error handling behavior.
98+ void remove_bad_alloc_error_handler ();
9999
100- void install_out_of_memory_new_handler ();
100+ void install_out_of_memory_new_handler ();
101101
102- // / Reports a bad alloc error, calling any user defined bad alloc
103- // / error handler. In contrast to the generic 'report_fatal_error'
104- // / functions, this function might not terminate, e.g. the user
105- // / defined error handler throws an exception, but it won't return.
106- // /
107- // / Note: When throwing an exception in the bad alloc handler, make sure that
108- // / the following unwind succeeds, e.g. do not trigger additional allocations
109- // / in the unwind chain.
110- // /
111- // / If no error handler is installed (default), throws a bad_alloc exception
112- // / if LLVM is compiled with exception support. Otherwise prints the error
113- // / to standard error and calls abort().
114- [[noreturn]] void report_bad_alloc_error (const char *Reason,
115- bool GenCrashDiag = true );
116-
117- // / This function calls abort(), and prints the optional message to stderr.
118- // / Use the llvm_unreachable macro (that adds location info), instead of
119- // / calling this function directly.
120- [[noreturn]] void
121- llvm_unreachable_internal ( const char *msg = nullptr , const char *file = nullptr ,
122- unsigned line = 0 );
102+ // / Reports a bad alloc error, calling any user defined bad alloc
103+ // / error handler. In contrast to the generic 'report_fatal_error'
104+ // / functions, this function might not terminate, e.g. the user
105+ // / defined error handler throws an exception, but it won't return.
106+ // /
107+ // / Note: When throwing an exception in the bad alloc handler, make sure that
108+ // / the following unwind succeeds, e.g. do not trigger additional allocations
109+ // / in the unwind chain.
110+ // /
111+ // / If no error handler is installed (default), throws a bad_alloc exception
112+ // / if LLVM is compiled with exception support. Otherwise prints the error
113+ // / to standard error and calls abort().
114+ [[noreturn]] void report_bad_alloc_error (const char *Reason,
115+ bool GenCrashDiag = true );
116+
117+ // / This function calls abort(), and prints the optional message to stderr.
118+ // / Use the llvm_unreachable macro (that adds location info), instead of
119+ // / calling this function directly.
120+ [[noreturn]] void llvm_unreachable_internal ( const char *msg = nullptr ,
121+ const char *file = nullptr ,
122+ unsigned line = 0 );
123123}
124124
125125// / Marks that the current location is not supposed to be reachable.
0 commit comments