Skip to content

Commit 91f2582

Browse files
committed
merge_irept should not destroy comments (but it may ignore differences)
We otherwise lose, e.g., ID_C_SSA_symbol
1 parent 23f1788 commit 91f2582

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/util/merge_irep.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ const irept& merge_irept::merged(const irept &irep)
200200
dest_named_sub[it->first]=merged(it->second); // recursive call
201201
#endif
202202

203+
const irept::named_subt &src_comments=irep.get_comments();
204+
irept::named_subt &dest_comments=new_irep.get_comments();
205+
206+
forall_named_irep(it, src_comments)
207+
#ifdef SUB_IS_LIST
208+
dest_comments.push_back(
209+
std::make_pair(it->first, merged(it->second))); // recursive call
210+
#else
211+
dest_comments[it->first]=merged(it->second); // recursive call
212+
#endif
213+
203214
return *irep_store.insert(new_irep).first;
204215
}
205216

0 commit comments

Comments
 (0)