File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,29 @@ class HLL::Backend::MoarVM {
87
87
$ escaped_squote := q { \\' } ;
88
88
}
89
89
90
+ my int $ new-id-counter := 0 ;
91
+ my $ id_remap := nqp ::hash();
90
92
my $ id_to_thing := nqp ::hash();
91
93
92
94
sub post_process_call_graph_node ($ node ) {
93
95
try {
96
+ if nqp ::existskey($ id_remap , $ node <id >) {
97
+ $ node <id > := $ id_remap {$ node <id >};
98
+ } else {
99
+ my str $ newkey := ~ ($ new-id-counter ++ );
100
+ $ id_remap {$ node <id >} := $ newkey ;
101
+ $ node <id > := $ newkey ;
102
+ }
94
103
if nqp ::existskey($ node , " allocations" ) {
95
104
for $ node <allocations > -> % alloc_info {
96
105
my $ type := % alloc_info <type >;
106
+ if nqp ::existskey($ id_remap , % alloc_info <id >) {
107
+ % alloc_info <id > := $ id_remap {% alloc_info <id >};
108
+ } else {
109
+ my str $ newkey := ~ ($ new-id-counter ++ );
110
+ $ id_remap {% alloc_info <id >} := $ newkey ;
111
+ % alloc_info <id > := $ newkey ;
112
+ }
97
113
unless nqp ::existskey($ id_to_thing , % alloc_info <id >) {
98
114
$ id_to_thing {% alloc_info <id >} := $ type . HOW . name ($ type );
99
115
}
You can’t perform that action at this time.
0 commit comments