pub struct CompilationUnit<'a> { /* private fields */ }
Expand description

This structure represents an editable DWARF compilation unit

Implementations§

§

impl CompilationUnit<'_>

pub fn set_producer(&mut self, value: &str)

Set the DW_AT_producer producer attribute.

This attribute aims to inform about the program that generated this compilation unit (e.g. LIEF Extended)

pub fn create_function(&mut self, name: &str) -> Option<Function>

Create a new function owned by this compilation unit

pub fn create_variable(&mut self, name: &str) -> Option<Variable>

Create a new global variable owned by this compilation unit

pub fn create_generic_type(&mut self, name: &str) -> Type

Create a DW_TAG_unspecified_type type with the given name

pub fn create_enum(&mut self, name: &str) -> Enum

Create an enum type (DW_TAG_enumeration_type)

pub fn create_typedef(&mut self, name: &str, ty: &dyn EditorType) -> Typedef

Create a typdef with the name provided in the first parameter which aliases the type provided in the second parameter

pub fn create_structure(&mut self, name: &str) -> Struct

Create a structure type (DW_TAG_structure_type)

pub fn create_class(&mut self, name: &str) -> Struct

Create a structure type (DW_TAG_class_type)

pub fn create_union(&mut self, name: &str) -> Struct

Create a union type (DW_TAG_union_type)

pub fn create_base_type( &mut self, name: &str, size: u64, encoding: Encoding ) -> Base

Create a primitive type with the given name and size.

pub fn create_function_type(&mut self, name: &str) -> FunctionType

Create a function type with the given name.

pub fn create_pointer_type(&mut self, ty: &dyn EditorType) -> Pointer

Create a pointer on the provided type

pub fn create_void_type(&mut self) -> Type

Create a void type

pub fn create_array_type( &mut self, name: &str, ty: &dyn EditorType, count: u64 ) -> Array

Create an array type with the given name, type and size.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for CompilationUnit<'a>

§

impl<'a> !Send for CompilationUnit<'a>

§

impl<'a> !Sync for CompilationUnit<'a>

§

impl<'a> Unpin for CompilationUnit<'a>

§

impl<'a> UnwindSafe for CompilationUnit<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.