+ /// setDiagnosticHandler - This method sets a handler that is invoked
+ /// when the backend needs to report anything to the user. The first
+ /// argument is a function pointer and the second is a context pointer that
+ /// gets passed into the DiagHandler.
+ ///
+ /// LLVMContext doesn't take ownership or interpret either of these
+ /// pointers.
+ void setDiagnosticHandler(DiagnosticHandlerTy DiagHandler,
+ void *DiagContext = 0);
+
+ /// getDiagnosticHandler - Return the diagnostic handler set by
+ /// setDiagnosticHandler.
+ DiagnosticHandlerTy getDiagnosticHandler() const;
+
+ /// getDiagnosticContext - Return the diagnostic context set by
+ /// setDiagnosticContext.
+ void *getDiagnosticContext() const;
+
+ /// diagnose - Report a message to the currently installed diagnostic handler.
+ /// This function returns, in particular in the case of error reporting
+ /// (DI.Severity == RS_Error), so the caller should leave the compilation
+ /// process in a self-consistent state, even though the generated code
+ /// need not be correct.
+ /// The diagnostic message will be implicitly prefixed with a severity
+ /// keyword according to \p DI.getSeverity(), i.e., "error: "
+ /// for RS_Error, "warning: " for RS_Warning, and "note: " for RS_Note.
+ void diagnose(const DiagnosticInfo &DI);