Function get_as_string

Source
pub fn get_as_string(val: &ValueRef) -> Option<String>
Expand description

Get the given constant data sequential as a string.

§Details

Retrieves the value as a string if the value is a constant string.

This function wraps the LLVMGetAsString function from the LLVM core library. It attempts to extract the value represented by ValueRef as a string if it is a constant string. The function returns None if the value is not a constant string, or Some(String) containing the string representation if it is.

§Returns

Returns an Option<String>:

  • Some(String) containing the string representation of the constant if it is a constant string.
  • None if the value is not a constant string.