Struct llvm_plugin_inkwell::debug_info::DebugInfoBuilder
source · [−]pub struct DebugInfoBuilder<'ctx> { /* private fields */ }Expand description
A builder object to create debug info metadata. Used along with Builder while producing
IR. Created by Module::create_debug_info_builder. See debug_info module level
documentation for more.
Implementations
sourceimpl<'ctx> DebugInfoBuilder<'ctx>
impl<'ctx> DebugInfoBuilder<'ctx>
sourcepub fn create_function(
&self,
scope: DIScope<'ctx>,
name: &str,
linkage_name: Option<&str>,
file: DIFile<'ctx>,
line_no: u32,
ditype: DISubroutineType<'ctx>,
is_local_to_unit: bool,
is_definition: bool,
scope_line: u32,
flags: DIFlags,
is_optimized: bool
) -> DISubprogram<'ctx>
pub fn create_function(
&self,
scope: DIScope<'ctx>,
name: &str,
linkage_name: Option<&str>,
file: DIFile<'ctx>,
line_no: u32,
ditype: DISubroutineType<'ctx>,
is_local_to_unit: bool,
is_definition: bool,
scope_line: u32,
flags: DIFlags,
is_optimized: bool
) -> DISubprogram<'ctx>
A DIFunction provides an anchor for all debugging information generated for the specified subprogram.
scope- Function scope.name- Function name.linkage_name- Mangled function name, if any.file- File where this variable is defined.line_no- Line number.ty- Function type.is_local_to_unit- True if this function is not externally visible.is_definition- True if this is a function definition (“When isDefinition: false, subprograms describe a declaration in the type tree as opposed to a definition of a function”).scope_line- Set to the beginning of the scope this startsflags- E.g.: LLVMDIFlagLValueReference. These flags are used to emit dwarf attributes.is_optimized- True if optimization is ON.
sourcepub fn create_lexical_block(
&self,
parent_scope: DIScope<'ctx>,
file: DIFile<'ctx>,
line: u32,
column: u32
) -> DILexicalBlock<'ctx>
pub fn create_lexical_block(
&self,
parent_scope: DIScope<'ctx>,
file: DIFile<'ctx>,
line: u32,
column: u32
) -> DILexicalBlock<'ctx>
Create a lexical block scope.
sourcepub fn create_file(&self, filename: &str, directory: &str) -> DIFile<'ctx>
pub fn create_file(&self, filename: &str, directory: &str) -> DIFile<'ctx>
Create a file scope.
sourcepub fn create_debug_location(
&self,
context: &Context,
line: u32,
column: u32,
scope: DIScope<'ctx>,
inlined_at: Option<DILocation<'ctx>>
) -> DILocation<'ctx>
pub fn create_debug_location(
&self,
context: &Context,
line: u32,
column: u32,
scope: DIScope<'ctx>,
inlined_at: Option<DILocation<'ctx>>
) -> DILocation<'ctx>
Create a debug location.
sourcepub fn create_basic_type(
&self,
name: &str,
size_in_bits: u64,
encoding: LLVMDWARFTypeEncoding,
flags: DIFlags
) -> Result<DIBasicType<'ctx>, &'static str>
pub fn create_basic_type(
&self,
name: &str,
size_in_bits: u64,
encoding: LLVMDWARFTypeEncoding,
flags: DIFlags
) -> Result<DIBasicType<'ctx>, &'static str>
Create a primitive basic type. encoding is an unsigned int flag (DW_ATE_*
enum) defined by the chosen DWARF standard.
sourcepub fn create_typedef(
&self,
ditype: DIType<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
scope: DIScope<'ctx>,
align_in_bits: u32
) -> DIDerivedType<'ctx>
pub fn create_typedef(
&self,
ditype: DIType<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
scope: DIScope<'ctx>,
align_in_bits: u32
) -> DIDerivedType<'ctx>
Create a typedef (alias) of ditype
sourcepub fn create_union_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
size_in_bits: u64,
align_in_bits: u32,
flags: DIFlags,
elements: &[DIType<'ctx>],
runtime_language: u32,
unique_id: &str
) -> DICompositeType<'ctx>
pub fn create_union_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
size_in_bits: u64,
align_in_bits: u32,
flags: DIFlags,
elements: &[DIType<'ctx>],
runtime_language: u32,
unique_id: &str
) -> DICompositeType<'ctx>
Create union type of multiple types.
sourcepub fn create_member_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: c_uint,
size_in_bits: u64,
align_in_bits: u32,
offset_in_bits: u64,
flags: DIFlags,
ty: DIType<'ctx>
) -> DIDerivedType<'ctx>
pub fn create_member_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: c_uint,
size_in_bits: u64,
align_in_bits: u32,
offset_in_bits: u64,
flags: DIFlags,
ty: DIType<'ctx>
) -> DIDerivedType<'ctx>
Create a type for a non-static member.
sourcepub fn create_struct_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: c_uint,
size_in_bits: u64,
align_in_bits: u32,
flags: DIFlags,
derived_from: Option<DIType<'ctx>>,
elements: &[DIType<'ctx>],
runtime_language: c_uint,
vtable_holder: Option<DIType<'ctx>>,
unique_id: &str
) -> DICompositeType<'ctx>
pub fn create_struct_type(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: c_uint,
size_in_bits: u64,
align_in_bits: u32,
flags: DIFlags,
derived_from: Option<DIType<'ctx>>,
elements: &[DIType<'ctx>],
runtime_language: c_uint,
vtable_holder: Option<DIType<'ctx>>,
unique_id: &str
) -> DICompositeType<'ctx>
Create a struct type.
sourcepub fn create_subroutine_type(
&self,
file: DIFile<'ctx>,
return_type: Option<DIType<'ctx>>,
parameter_types: &[DIType<'ctx>],
flags: DIFlags
) -> DISubroutineType<'ctx>
pub fn create_subroutine_type(
&self,
file: DIFile<'ctx>,
return_type: Option<DIType<'ctx>>,
parameter_types: &[DIType<'ctx>],
flags: DIFlags
) -> DISubroutineType<'ctx>
Create a function type
pub fn create_global_variable_expression(
&self,
scope: DIScope<'ctx>,
name: &str,
linkage: &str,
file: DIFile<'ctx>,
line_no: u32,
ty: DIType<'ctx>,
local_to_unit: bool,
expression: Option<DIExpression<'_>>,
declaration: Option<DIScope<'_>>,
align_in_bits: u32
) -> DIGlobalVariableExpression<'ctx>
pub fn create_constant_expression(&self, value: i64) -> DIExpression<'ctx>
sourcepub fn create_parameter_variable(
&self,
scope: DIScope<'ctx>,
name: &str,
arg_no: u32,
file: DIFile<'ctx>,
line_no: u32,
ty: DIType<'ctx>,
always_preserve: bool,
flags: DIFlags
) -> DILocalVariable<'ctx>
pub fn create_parameter_variable(
&self,
scope: DIScope<'ctx>,
name: &str,
arg_no: u32,
file: DIFile<'ctx>,
line_no: u32,
ty: DIType<'ctx>,
always_preserve: bool,
flags: DIFlags
) -> DILocalVariable<'ctx>
Create function parameter variable.
sourcepub fn create_auto_variable(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
ty: DIType<'ctx>,
always_preserve: bool,
flags: DIFlags,
align_in_bits: u32
) -> DILocalVariable<'ctx>
pub fn create_auto_variable(
&self,
scope: DIScope<'ctx>,
name: &str,
file: DIFile<'ctx>,
line_no: u32,
ty: DIType<'ctx>,
always_preserve: bool,
flags: DIFlags,
align_in_bits: u32
) -> DILocalVariable<'ctx>
Create local automatic storage variable.
pub fn create_namespace(
&self,
scope: DIScope<'ctx>,
name: &str,
export_symbols: bool
) -> DINamespace<'ctx>
sourcepub fn insert_declare_before_instruction(
&self,
storage: PointerValue<'ctx>,
var_info: Option<DILocalVariable<'ctx>>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
instruction: InstructionValue<'ctx>
) -> InstructionValue<'ctx>
pub fn insert_declare_before_instruction(
&self,
storage: PointerValue<'ctx>,
var_info: Option<DILocalVariable<'ctx>>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
instruction: InstructionValue<'ctx>
) -> InstructionValue<'ctx>
Insert a variable declaration (llvm.dbg.declare) before a specified instruction.
sourcepub fn insert_declare_at_end(
&self,
storage: PointerValue<'ctx>,
var_info: Option<DILocalVariable<'ctx>>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
block: BasicBlock<'ctx>
) -> InstructionValue<'ctx>
pub fn insert_declare_at_end(
&self,
storage: PointerValue<'ctx>,
var_info: Option<DILocalVariable<'ctx>>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
block: BasicBlock<'ctx>
) -> InstructionValue<'ctx>
Insert a variable declaration (llvm.dbg.declare intrinsic) at the end of block
sourcepub fn create_expression(
&self,
address_operations: Vec<i64>
) -> DIExpression<'ctx>
pub fn create_expression(
&self,
address_operations: Vec<i64>
) -> DIExpression<'ctx>
Create an expression
sourcepub fn insert_dbg_value_before(
&self,
value: BasicValueEnum<'ctx>,
var_info: DILocalVariable<'ctx>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
instruction: InstructionValue<'ctx>
) -> InstructionValue<'ctx>
pub fn insert_dbg_value_before(
&self,
value: BasicValueEnum<'ctx>,
var_info: DILocalVariable<'ctx>,
expr: Option<DIExpression<'ctx>>,
debug_loc: DILocation<'ctx>,
instruction: InstructionValue<'ctx>
) -> InstructionValue<'ctx>
Insert a new llvm.dbg.value intrinsic call before an instruction.
sourcepub unsafe fn create_placeholder_derived_type(
&self,
context: &Context
) -> DIDerivedType<'ctx>
pub unsafe fn create_placeholder_derived_type(
&self,
context: &Context
) -> DIDerivedType<'ctx>
Construct a placeholders derived type to be used when building debug info with circular references.
All placeholders must be replaced before calling finalize().
sourcepub unsafe fn replace_placeholder_derived_type(
&self,
placeholder: DIDerivedType<'ctx>,
other: DIDerivedType<'ctx>
)
pub unsafe fn replace_placeholder_derived_type(
&self,
placeholder: DIDerivedType<'ctx>,
other: DIDerivedType<'ctx>
)
Deletes a placeholder, replacing all uses of it with another derived type.
Safety:
This and any other copies of this placeholder made by Copy or Clone become dangling pointers after calling this method.
Trait Implementations
sourceimpl<'ctx> Debug for DebugInfoBuilder<'ctx>
impl<'ctx> Debug for DebugInfoBuilder<'ctx>
sourceimpl<'ctx> Drop for DebugInfoBuilder<'ctx>
impl<'ctx> Drop for DebugInfoBuilder<'ctx>
sourceimpl<'ctx> PartialEq<DebugInfoBuilder<'ctx>> for DebugInfoBuilder<'ctx>
impl<'ctx> PartialEq<DebugInfoBuilder<'ctx>> for DebugInfoBuilder<'ctx>
sourcefn eq(&self, other: &DebugInfoBuilder<'ctx>) -> bool
fn eq(&self, other: &DebugInfoBuilder<'ctx>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl<'ctx> Eq for DebugInfoBuilder<'ctx>
impl<'ctx> StructuralEq for DebugInfoBuilder<'ctx>
impl<'ctx> StructuralPartialEq for DebugInfoBuilder<'ctx>
Auto Trait Implementations
impl<'ctx> RefUnwindSafe for DebugInfoBuilder<'ctx>
impl<'ctx> !Send for DebugInfoBuilder<'ctx>
impl<'ctx> !Sync for DebugInfoBuilder<'ctx>
impl<'ctx> Unpin for DebugInfoBuilder<'ctx>
impl<'ctx> UnwindSafe for DebugInfoBuilder<'ctx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more