[llvm-commits] [llvm] r79505 - /llvm/trunk/include/llvm/Support/ErrorHandling.h

Török Edwin edwintorok at gmail.com
Thu Aug 20 09:16:30 PDT 2009


On 2009-08-20 04:46, Dan Gohman wrote:
> Author: djg
> Date: Wed Aug 19 20:46:24 2009
> New Revision: 79505
>
> URL: http://llvm.org/viewvc/llvm-project?rev=79505&view=rev
> Log:
> Add some comments clarifying what appear to be the intent of various
> error handling mechanisms. Please correct these if I've misunderstood
> something.
>
>  
> -  /// Reports a serious error, calling any installed error handler.
> +  /// Reports a serious error, calling any installed error handler. These
> +  /// functions are intended to be used for error conditions which are outside
> +  /// the control of the compiler (I/O errors, invalid user input, etc.)
> +  ///
>   

Yes, errors that could in theory be recovered from.
IMHO anything that is not an assert and can fail should use this mechanism.

>    /// If no error handler is installed the default is to print the message to
>    /// standard error, followed by a newline.
>    /// After the error handler is called this function will call exit(1), it 
>   

The initial idea was to also change code that calls llvm_report_error to
recover from such errors.
Currently this is not possible (the error handler is not allowed to
return to LLVM), but I'd like to slowly change things after llvm 2.6 is
released.

For example if the JIT encounters inline asm, or unresolved external
symbol, it could try to recover.

Best regards,
--Edwin



More information about the llvm-commits mailing list