]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Create separate lexical block for function bodies.
authorMichael Woerister <michaelwoerister@gmail>
Fri, 13 Dec 2013 11:40:06 +0000 (12:40 +0100)
committerMichael Woerister <michaelwoerister@gmail>
Mon, 16 Dec 2013 09:23:28 +0000 (10:23 +0100)
src/librustc/middle/trans/debuginfo.rs

index 71cc6109a47ad5fe93486c057a5cd4c064d1c944..77afe57474946600d806cf38dc884a2350ed17c3 100644 (file)
@@ -2248,7 +2248,14 @@ struct ScopeStackEntry {
         })
     }
 
-    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,