From 91f2582549069d5cb0eaaceeb7700172cca5538c Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 4 Mar 2016 00:07:10 +0000 Subject: [PATCH] merge_irept should not destroy comments (but it may ignore differences) We otherwise lose, e.g., ID_C_SSA_symbol --- src/util/merge_irep.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/util/merge_irep.cpp b/src/util/merge_irep.cpp index 68259de7832..29df460cae7 100644 --- a/src/util/merge_irep.cpp +++ b/src/util/merge_irep.cpp @@ -200,6 +200,17 @@ const irept& merge_irept::merged(const irept &irep) dest_named_sub[it->first]=merged(it->second); // recursive call #endif + const irept::named_subt &src_comments=irep.get_comments(); + irept::named_subt &dest_comments=new_irep.get_comments(); + + forall_named_irep(it, src_comments) + #ifdef SUB_IS_LIST + dest_comments.push_back( + std::make_pair(it->first, merged(it->second))); // recursive call + #else + dest_comments[it->first]=merged(it->second); // recursive call + #endif + return *irep_store.insert(new_irep).first; }