cg_llvm: remove pointee types and pointercast/bitcast-of-ptr
This commit is contained in:
parent
4c96822796
commit
b6540777fe
17 changed files with 118 additions and 283 deletions
|
@ -17,8 +17,7 @@ use rustc_span::symbol::sym;
|
|||
/// .debug_gdb_scripts global is referenced, so it isn't removed by the linker.
|
||||
pub fn insert_reference_to_gdb_debug_scripts_section_global(bx: &mut Builder<'_, '_, '_>) {
|
||||
if needs_gdb_debug_scripts_section(bx) {
|
||||
let gdb_debug_scripts_section =
|
||||
bx.const_bitcast(get_or_insert_gdb_debug_scripts_section_global(bx), bx.type_i8p());
|
||||
let gdb_debug_scripts_section = get_or_insert_gdb_debug_scripts_section_global(bx);
|
||||
// Load just the first byte as that's all that's necessary to force
|
||||
// LLVM to keep around the reference to the global.
|
||||
let volatile_load_instruction = bx.volatile_load(bx.type_i8(), gdb_debug_scripts_section);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue