Struct inkwell::debug_info::DebugInfoBuilder [−][src]
pub struct DebugInfoBuilder<'ctx> { /* fields omitted */ }
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
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>
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.
pub 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.
Create a file scope.
pub 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.
pub fn create_basic_type(
&self,
name: &str,
size_in_bits: u64,
encoding: LLVMDWARFTypeEncoding,
flags: DIFlags
) -> Result<DIBasicType<'ctx>, &'static str>
This is supported on crate features llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
pub fn create_basic_type(
&self,
name: &str,
size_in_bits: u64,
encoding: LLVMDWARFTypeEncoding,
flags: DIFlags
) -> Result<DIBasicType<'ctx>, &'static str>
llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.Create a primitive basic type. encoding
is an unsigned int flag (DW_ATE_*
enum) defined by the chosen DWARF standard.
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>
This is supported on crate features llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
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>
llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.Create a typedef (alias) of ditype
Create union type of multiple types.
Create a type for a non-static member.
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>
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.
pub 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>
llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.Create function parameter variable.
Create local automatic storage variable.
pub fn create_namespace(
&self,
scope: DIScope<'ctx>,
name: &str,
export_symbols: bool
) -> DINamespace<'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>
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.
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>
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
Create an expression
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>
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.
pub 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().
pub 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.