]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Set the is_local_to_unit attribute of functions correctly
authorMichael Woerister <michaelwoerister@gmail>
Fri, 13 Dec 2013 14:16:05 +0000 (15:16 +0100)
committerMichael Woerister <michaelwoerister@gmail>
Mon, 16 Dec 2013 09:23:28 +0000 (10:23 +0100)
src/librustc/middle/trans/debuginfo.rs
src/test/debug-info/basic-types-metadata.rs

index 631f32fcd68a2bc1cf3f6d48aacd82d6d7f8d765..9aaaf27b34574aeb884f7a11b1e9af5730ac11bd 100644 (file)
@@ -653,6 +653,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
 
     // Clang sets this parameter to the opening brace of the function's block, so let's do this too.
     let scope_line = span_start(cx, top_level_block.span).line;
+    let is_local_to_unit = !cx.reachable.contains(&fn_ast_id);
 
     let fn_metadata = function_name.with_c_str(|function_name| {
                           linkage_name.with_c_str(|linkage_name| {
@@ -665,7 +666,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
                     file_metadata,
                     loc.line as c_uint,
                     function_type_metadata,
-                    false,
+                    is_local_to_unit,
                     true,
                     scope_line as c_uint,
                     FlagPrototyped as c_uint,
index 18683102b2abb3105d3e10b7750a6c575d5c3d33..0e48b5db7ce780c8fd749dfd11c47f405a98fc8f 100644 (file)
@@ -45,8 +45,7 @@
 // debugger:whatis f64
 // check:type = f64
 // debugger:info functions _yyy
-// check:[...]
-// check:![...]_yyy()();
+// check:[...]![...]_yyy()();
 // debugger:detach
 // debugger:quit