diff options
| author | bors <bors@rust-lang.org> | 2021-08-04 18:22:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-04 18:22:29 +0000 |
| commit | d54fbb98555c107fb62fb5ae1a5b8f4fc6ed3edc (patch) | |
| tree | 63f0a2cc0ac3e03b2a749db84f2c2477ba381d23 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | 6fe0886723c9e08b800c9951f1c6f6a57b2bf22c (diff) | |
| parent | 8e0df32ad6dd4e171742dc159a08f247c1a256ab (diff) | |
| download | rust-d54fbb98555c107fb62fb5ae1a5b8f4fc6ed3edc.tar.gz rust-d54fbb98555c107fb62fb5ae1a5b8f4fc6ed3edc.zip | |
Auto merge of #87695 - tmiasko:gep-opaque-pointers, r=nagisa
Prepare GEP building for opaque pointers
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs index de3f719b816..c33d35cc285 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs @@ -15,12 +15,11 @@ 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 = get_or_insert_gdb_debug_scripts_section_global(bx); + let gdb_debug_scripts_section = + bx.const_bitcast(get_or_insert_gdb_debug_scripts_section_global(bx), bx.type_i8p()); // Load just the first byte as that's all that's necessary to force // LLVM to keep around the reference to the global. - let indices = [bx.const_i32(0), bx.const_i32(0)]; - let element = bx.inbounds_gep(gdb_debug_scripts_section, &indices); - let volative_load_instruction = bx.volatile_load(bx.type_i8(), element); + let volative_load_instruction = bx.volatile_load(bx.type_i8(), gdb_debug_scripts_section); unsafe { llvm::LLVMSetAlignment(volative_load_instruction, 1); } |
