pub struct DiagnosticInfoRef(/* private fields */);
Expand description
LLVM Diagnostic Info structure wrapper
Implementations§
Source§impl DiagnosticInfoRef
impl DiagnosticInfoRef
Sourcepub fn get_description(&self) -> Option<String>
pub fn get_description(&self) -> Option<String>
Return a string representation of the DiagnosticInfo
.
§Details
This function wraps the LLVMGetDiagInfoDescription
function from the LLVM core library. It retrieves a description
of the diagnostic information represented by self
as a String
. The description provides a human-readable explanation
of the diagnostic. After obtaining the string, the memory is freed using LLVMDisposeMessage
.
§Returns
Returns an Option<String>
:
Some(String)
containing the description of the diagnostic if successful.None
if the description could not be retrieved.
§Safety
This function allocates memory for the string, which is freed using LLVMDisposeMessage
.
Sourcepub fn get_severity(&self) -> DiagnosticSeverity
pub fn get_severity(&self) -> DiagnosticSeverity
Return an enum DiagnosticSeverity
type
§Details
Retrieves the severity level of the diagnostic information.
This function wraps the LLVMGetDiagInfoSeverity
function from the LLVM core library. It returns the severity
level of the diagnostic information represented by self
. The severity level indicates the nature of the diagnostic,
such as whether it is an error, warning, remark, or note.
§Returns
Returns a DiagnosticSeverity
enum variant representing the severity level of the diagnostic.