about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
diff options
context:
space:
mode:
authorDenis Merigoux <denis.merigoux@gmail.com>2018-08-28 17:50:57 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 14:11:59 +0200
commitd3258448045d672b0cd273cb1ea9381b470c2ca2 (patch)
tree8c4b20fa7ddb041ede6b9040ee11eeb91f721980 /src/librustc_codegen_llvm/debuginfo
parent8714e6bce6b04482723f0b735879533c82c114fa (diff)
downloadrust-d3258448045d672b0cd273cb1ea9381b470c2ca2.tar.gz
rust-d3258448045d672b0cd273cb1ea9381b470c2ca2.zip
Replaced Codegen field access by trait method
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/gdb.rs6
-rw-r--r--src/librustc_codegen_llvm/debuginfo/mod.rs2
-rw-r--r--src/librustc_codegen_llvm/debuginfo/source_loc.rs6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/gdb.rs b/src/librustc_codegen_llvm/debuginfo/gdb.rs
index 252650e52ba..13392a64c7b 100644
--- a/src/librustc_codegen_llvm/debuginfo/gdb.rs
+++ b/src/librustc_codegen_llvm/debuginfo/gdb.rs
@@ -26,11 +26,11 @@ use syntax::attr;
 /// Inserts a side-effect free instruction sequence that makes sure that the
 /// .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: &Builder) {
-    if needs_gdb_debug_scripts_section(bx.cx) {
-        let gdb_debug_scripts_section = get_or_insert_gdb_debug_scripts_section_global(bx.cx);
+    if needs_gdb_debug_scripts_section(bx.cx()) {
+        let gdb_debug_scripts_section = get_or_insert_gdb_debug_scripts_section_global(bx.cx());
         // 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 = [CodegenCx::c_i32(bx.cx, 0), CodegenCx::c_i32(bx.cx, 0)];
+        let indices = [CodegenCx::c_i32(bx.cx(), 0), CodegenCx::c_i32(bx.cx(), 0)];
         let element = bx.inbounds_gep(gdb_debug_scripts_section, &indices);
         let volative_load_instruction = bx.volatile_load(element);
         unsafe {
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs
index b7f70a67491..0ee51f1956b 100644
--- a/src/librustc_codegen_llvm/debuginfo/mod.rs
+++ b/src/librustc_codegen_llvm/debuginfo/mod.rs
@@ -494,7 +494,7 @@ pub fn declare_local(
     span: Span,
 ) {
     assert!(!dbg_context.get_ref(span).source_locations_enabled.get());
-    let cx = bx.cx;
+    let cx = bx.cx();
 
     let file = span_start(cx, span).file;
     let file_metadata = file_metadata(cx,
diff --git a/src/librustc_codegen_llvm/debuginfo/source_loc.rs b/src/librustc_codegen_llvm/debuginfo/source_loc.rs
index 8785ecfa05b..96d22ea1d15 100644
--- a/src/librustc_codegen_llvm/debuginfo/source_loc.rs
+++ b/src/librustc_codegen_llvm/debuginfo/source_loc.rs
@@ -42,7 +42,7 @@ pub fn set_source_location(
 
     let dbg_loc = if function_debug_context.source_locations_enabled.get() {
         debug!("set_source_location: {}", bx.sess().source_map().span_to_string(span));
-        let loc = span_start(bx.cx, span);
+        let loc = span_start(bx.cx(), span);
         InternalDebugLocation::new(scope.unwrap(), loc.line, loc.col.to_usize())
     } else {
         UnknownLocation
@@ -88,7 +88,7 @@ pub fn set_debug_location(
             // For MSVC, set the column number to zero.
             // Otherwise, emit it. This mimics clang behaviour.
             // See discussion in https://github.com/rust-lang/rust/issues/42921
-            let col_used =  if bx.cx.sess().target.target.options.is_like_msvc {
+            let col_used =  if bx.cx().sess().target.target.options.is_like_msvc {
                 UNKNOWN_COLUMN_NUMBER
             } else {
                 col as c_uint
@@ -97,7 +97,7 @@ pub fn set_debug_location(
 
             unsafe {
                 Some(llvm::LLVMRustDIBuilderCreateDebugLocation(
-                    debug_context(bx.cx).llcontext,
+                    debug_context(bx.cx()).llcontext,
                     line as c_uint,
                     col_used,
                     scope,