Created
January 29, 2012 23:55
-
-
Save jdm/1701436 to your computer and use it in GitHub Desktop.
Perf improvements for debuginfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/comp/middle/debuginfo.rs b/src/comp/middle/debuginfo.rs | |
index 4d81b68..0ab1a8e 100644 | |
--- a/src/comp/middle/debuginfo.rs | |
+++ b/src/comp/middle/debuginfo.rs | |
@@ -101,7 +101,7 @@ type metadata<T> = {node: ValueRef, data: T}; | |
type file_md = {path: str}; | |
type compile_unit_md = {path: str}; | |
-type subprogram_md = {path: str}; | |
+type subprogram_md = {id: ast::node_id}; | |
type local_var_md = {id: ast::node_id}; | |
type tydesc_md = {hash: uint}; | |
type block_md = {start: codemap::loc, end: codemap::loc}; | |
@@ -241,12 +241,12 @@ fn create_block(cx: @block_ctxt) -> @metadata<block_md> { | |
let end = codemap::lookup_char_pos(bcx_ccx(cx).sess.codemap, | |
sp.hi); | |
let tg = LexicalBlockTag; | |
- alt cached_metadata::<@metadata<block_md>>( | |
+ /*alt cached_metadata::<@metadata<block_md>>( | |
cache, tg, | |
{|md| start == md.data.start && end == md.data.end}) { | |
option::some(md) { ret md; } | |
option::none {} | |
- } | |
+ }*/ | |
let parent = alt cx.parent { | |
parent_none { create_function(cx.fcx).node } | |
@@ -266,7 +266,7 @@ fn create_block(cx: @block_ctxt) -> @metadata<block_md> { | |
]; | |
let val = llmdnode(lldata); | |
let mdval = @{node: val, data: {start: start, end: end}}; | |
- update_cache(cache, tg, block_metadata(mdval)); | |
+ //update_cache(cache, tg, block_metadata(mdval)); | |
ret mdval; | |
} | |
@@ -764,16 +764,15 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> { | |
log(debug, ident); | |
log(debug, id); | |
- let path = str::connect(fcx.lcx.path + [ident], "::"); | |
- | |
let cache = get_cache(cx); | |
alt cached_metadata::<@metadata<subprogram_md>>( | |
- cache, SubprogramTag, {|md| md.data.path == path && | |
- /*md.data.path == ??*/ true}) { | |
+ cache, SubprogramTag, {|md| md.data.id == id}) { | |
option::some(md) { ret md; } | |
option::none {} | |
} | |
+ let path = str::connect(fcx.lcx.path + [ident], "::"); | |
+ | |
let loc = codemap::lookup_char_pos(cx.sess.codemap, | |
sp.lo); | |
let file_node = create_file(cx, loc.filename).node; | |
@@ -815,7 +814,7 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> { | |
]; | |
let val = llmdnode(fn_metadata); | |
add_named_metadata(cx, "llvm.dbg.sp", val); | |
- let mdval = @{node: val, data: {path: path}}; | |
+ let mdval = @{node: val, data: {id: id}}; | |
update_cache(cache, SubprogramTag, subprogram_metadata(mdval)); | |
ret mdval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment