Skip to content

Commit

Permalink
debuginfo: Add comment on is_local_to_unit parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Dec 16, 2013
1 parent d35fff8 commit 9384de7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustc/middle/trans/debuginfo.rs
Expand Up @@ -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| {
Expand Down

5 comments on commit 9384de7

@bors
Copy link
Contributor

@bors bors commented on 9384de7 Dec 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from cmr
at michaelwoerister@9384de7

@bors
Copy link
Contributor

@bors bors commented on 9384de7 Dec 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging michaelwoerister/rust/prelude2 = 9384de7 into auto

@bors
Copy link
Contributor

@bors bors commented on 9384de7 Dec 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

michaelwoerister/rust/prelude2 = 9384de7 merged ok, testing candidate = 4e77c11

@bors
Copy link
Contributor

@bors bors commented on 9384de7 Dec 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 9384de7 Dec 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4e77c11

Please sign in to comment.