diff options
| author | Michael Woerister <michaelwoerister@gmail> | 2013-12-13 12:40:06 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@gmail> | 2013-12-16 10:23:28 +0100 |
| commit | 7eae649a015cd2e4c5764b2955edb7542410f1f1 (patch) | |
| tree | 3cc212489b9de6bd6ada260e642e3eeec1a4122d | |
| parent | 184d39414d779b620fec719cbd8308960634b277 (diff) | |
| download | rust-7eae649a015cd2e4c5764b2955edb7542410f1f1.tar.gz rust-7eae649a015cd2e4c5764b2955edb7542410f1f1.zip | |
debuginfo: Create separate lexical block for function bodies.
| -rw-r--r-- | src/librustc/middle/trans/debuginfo.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index 71cc6109a47..77afe574749 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -2248,7 +2248,14 @@ fn populate_scope_map(cx: &mut CrateContext, }) } - walk_block(cx, fn_entry_block, &mut scope_stack, scope_map); + // Clang creates separate scope functions bodies, so let's do this too + with_new_scope(cx, + fn_entry_block.span, + &mut scope_stack, + scope_map, + |cx, scope_stack, scope_map| { + walk_block(cx, fn_entry_block, scope_stack, scope_map); + }); // local helper functions for walking the AST. fn with_new_scope(cx: &mut CrateContext, |
