about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@gmail>2013-12-14 17:12:59 +0100
committerMichael Woerister <michaelwoerister@gmail>2013-12-16 10:23:28 +0100
commit9384de77bbc8edf5e7c7c1a84e79cd29588cdee9 (patch)
treec80da98dfea2d6cf4c19f004ba6d516da7237779 /src
parentd35fff89944f583f4f96b384e3f5d075503e0d36 (diff)
downloadrust-9384de77bbc8edf5e7c7c1a84e79cd29588cdee9.tar.gz
rust-9384de77bbc8edf5e7c7c1a84e79cd29588cdee9.zip
debuginfo: Add comment on is_local_to_unit parameter.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/trans/debuginfo.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index 2a1aada6d24..0783d5b418f 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -690,6 +690,13 @@ 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;
+
+    // The is_local_to_unit flag indicates whether a function is local to the current compilation
+    // unit (i.e. if it is *static* in the C-sense). The *reachable* set should provide a good
+    // approximation of this, as it contains everything that might leak out of the current crate
+    // (by being externally visible or by being inlined into something externally visible). It might
+    // better to use the `exported_items` set from `driver::CrateAnalysis` in the future, but (atm)
+    // this set is not available in the translation pass.
     let is_local_to_unit = !cx.reachable.contains(&fn_ast_id);
 
     let fn_metadata = function_name.with_c_str(|function_name| {