about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMark-Simulacrum <mark.simulacrum@gmail.com>2016-12-15 15:08:18 -0700
committerMark Simulacrum <mark.simulacrum@gmail.com>2016-12-20 20:02:51 -0700
commit14ae76d96b87d6b3e8cbe9264534e148ee88fb89 (patch)
tree8ea59d78dfdbd54a1559fd81ed3f8d6f9e2c3f7b /src
parentb10d89a0961bb8682dc3e6d2781c6e390c6cf25c (diff)
downloadrust-14ae76d96b87d6b3e8cbe9264534e148ee88fb89.tar.gz
rust-14ae76d96b87d6b3e8cbe9264534e148ee88fb89.zip
Unbox FunctionDebugContextData.
It is only a pointer and a Cell, which is quite small.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trans/debuginfo/create_scope_map.rs2
-rw-r--r--src/librustc_trans/debuginfo/mod.rs14
-rw-r--r--src/librustc_trans/debuginfo/source_loc.rs10
3 files changed, 7 insertions, 19 deletions
diff --git a/src/librustc_trans/debuginfo/create_scope_map.rs b/src/librustc_trans/debuginfo/create_scope_map.rs
index e0c1a80be39..23f415d95cf 100644
--- a/src/librustc_trans/debuginfo/create_scope_map.rs
+++ b/src/librustc_trans/debuginfo/create_scope_map.rs
@@ -54,7 +54,7 @@ pub fn create_mir_scopes(fcx: &FunctionContext) -> IndexVec<VisibilityScope, Mir
     let mut scopes = IndexVec::from_elem(null_scope, &mir.visibility_scopes);
 
     let fn_metadata = match fcx.debug_context {
-        FunctionDebugContext::RegularContext(box ref data) => data.fn_metadata,
+        FunctionDebugContext::RegularContext(ref data) => data.fn_metadata,
         FunctionDebugContext::DebugInfoDisabled |
         FunctionDebugContext::FunctionWithoutDebugInfo => {
             return scopes;
diff --git a/src/librustc_trans/debuginfo/mod.rs b/src/librustc_trans/debuginfo/mod.rs
index f59ecf1d678..1bf3c0acec5 100644
--- a/src/librustc_trans/debuginfo/mod.rs
+++ b/src/librustc_trans/debuginfo/mod.rs
@@ -97,7 +97,7 @@ impl<'tcx> CrateDebugContext<'tcx> {
 }
 
 pub enum FunctionDebugContext {
-    RegularContext(Box<FunctionDebugContextData>),
+    RegularContext(FunctionDebugContextData),
     DebugInfoDisabled,
     FunctionWithoutDebugInfo,
 }
@@ -107,7 +107,7 @@ impl FunctionDebugContext {
                    span: Span)
                    -> &'a FunctionDebugContextData {
         match *self {
-            FunctionDebugContext::RegularContext(box ref data) => data,
+            FunctionDebugContext::RegularContext(ref data) => data,
             FunctionDebugContext::DebugInfoDisabled => {
                 span_bug!(span,
                           "{}",
@@ -134,7 +134,6 @@ impl FunctionDebugContext {
 pub struct FunctionDebugContextData {
     fn_metadata: DISubprogram,
     source_locations_enabled: Cell<bool>,
-    source_location_override: Cell<bool>,
 }
 
 pub enum VariableAccess<'a> {
@@ -293,10 +292,9 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
     };
 
     // Initialize fn debug context (including scope map and namespace map)
-    let fn_debug_context = box FunctionDebugContextData {
+    let fn_debug_context = FunctionDebugContextData {
         fn_metadata: fn_metadata,
         source_locations_enabled: Cell::new(false),
-        source_location_override: Cell::new(false),
     };
 
     return FunctionDebugContext::RegularContext(fn_debug_context);
@@ -503,11 +501,7 @@ pub fn declare_local<'blk, 'tcx>(bcx: &BlockAndBuilder<'blk, 'tcx>,
 
     match variable_kind {
         ArgumentVariable(_) | CapturedVariable => {
-            assert!(!bcx.fcx()
-                        .debug_context
-                        .get_ref(span)
-                        .source_locations_enabled
-                        .get());
+            assert!(!bcx.fcx().debug_context.get_ref(span).source_locations_enabled.get());
             source_loc::set_debug_location(cx, None, UnknownLocation);
         }
         _ => { /* nothing to do */ }
diff --git a/src/librustc_trans/debuginfo/source_loc.rs b/src/librustc_trans/debuginfo/source_loc.rs
index 1aee27c144a..86ecc0e65a9 100644
--- a/src/librustc_trans/debuginfo/source_loc.rs
+++ b/src/librustc_trans/debuginfo/source_loc.rs
@@ -36,15 +36,9 @@ pub fn set_source_location(fcx: &FunctionContext,
             set_debug_location(fcx.ccx, builder, UnknownLocation);
             return;
         }
-        FunctionDebugContext::RegularContext(box ref data) => data
+        FunctionDebugContext::RegularContext(ref data) => data
     };
 
-    if function_debug_context.source_location_override.get() {
-        // Just ignore any attempts to set a new debug location while
-        // the override is active.
-        return;
-    }
-
     let dbg_loc = if function_debug_context.source_locations_enabled.get() {
         let (scope, span) = match debug_loc {
             DebugLoc::ScopeAt(scope, span) => (scope, span),
@@ -72,7 +66,7 @@ pub fn set_source_location(fcx: &FunctionContext,
 /// first real statement/expression of the function is translated.
 pub fn start_emitting_source_locations(fcx: &FunctionContext) {
     match fcx.debug_context {
-        FunctionDebugContext::RegularContext(box ref data) => {
+        FunctionDebugContext::RegularContext(ref data) => {
             data.source_locations_enabled.set(true)
         },
         _ => { /* safe to ignore */ }