Skip to content

Commit ecb76e2

Browse files
committed
irept: use single map for all named sub-nodes
1 parent 961d974 commit ecb76e2

File tree

15 files changed

+108
-204
lines changed

15 files changed

+108
-204
lines changed

src/cpp/cpp_type2name.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,29 @@ static void irep2name(const irept &irep, std::string &result)
3636
if(irep.id()!="")
3737
result+=do_prefix(irep.id_string());
3838

39-
if(irep.get_named_sub().empty() &&
40-
irep.get_sub().empty() &&
41-
irep.get_comments().empty())
39+
if(irep.get_named_sub().empty() && irep.get_sub().empty())
4240
return;
4341

4442
result+='(';
4543
bool first=true;
4644

4745
forall_named_irep(it, irep.get_named_sub())
48-
{
49-
if(first)
50-
first=false;
51-
else
52-
result+=',';
46+
if(!irept::is_comment(it->first))
47+
{
48+
if(first)
49+
first = false;
50+
else
51+
result += ',';
5352

54-
result+=do_prefix(name2string(it->first));
53+
result += do_prefix(name2string(it->first));
5554

56-
result+='=';
57-
std::string tmp;
58-
irep2name(it->second, tmp);
59-
result+=tmp;
60-
}
55+
result += '=';
56+
std::string tmp;
57+
irep2name(it->second, tmp);
58+
result += tmp;
59+
}
6160

62-
forall_named_irep(it, irep.get_comments())
61+
forall_named_irep(it, irep.get_named_sub())
6362
if(it->first==ID_C_constant ||
6463
it->first==ID_C_volatile ||
6564
it->first==ID_C_restricted)

src/goto-programs/json_goto_trace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void convert_decl(
155155
if(trace_options.json_full_lhs)
156156
{
157157
// Not language specific, still mangled, fully-qualified name of lhs
158-
json_assignment["rawLhs"] = json_irept(true).convert_from_irep(simplified);
158+
json_assignment["rawLhs"] = json_irept().convert_from_irep(simplified);
159159
}
160160
json_assignment["hidden"] = jsont::json_boolean(step.hidden);
161161
json_assignment["internal"] = jsont::json_boolean(step.internal);

src/goto-programs/show_goto_functions_json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ json_objectt show_goto_functions_jsont::convert(
4040
const goto_functionst &goto_functions)
4141
{
4242
json_arrayt json_functions;
43-
const json_irept no_comments_irep_converter(false);
43+
const json_irept no_comments_irep_converter;
4444

4545
const auto sorted = goto_functions.sorted();
4646

src/goto-programs/show_symbol_table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void show_symbol_table_json_ui(
166166
result_wrapper.push_back_stream_object("symbolTable");
167167

168168
const namespacet ns(symbol_table);
169-
json_irept irep_converter(true);
169+
json_irept irep_converter;
170170

171171
for(const auto &id_and_symbol : symbol_table.symbols)
172172
{
@@ -241,7 +241,7 @@ static void show_symbol_table_brief_json_ui(
241241
result_wrapper.push_back_stream_object("symbolTable");
242242

243243
const namespacet ns(symbol_table);
244-
json_irept irep_converter(true);
244+
json_irept irep_converter;
245245

246246
for(const auto &id_and_symbol : symbol_table.symbols)
247247
{

src/json-symtab-language/json_symbol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ symbolt symbol_from_json(const jsont &in)
4747
if(!in.is_object())
4848
throw deserialization_exceptiont("symbol_from_json takes an object");
4949
symbolt result;
50-
json_irept json2irep(true);
50+
json_irept json2irep;
5151
for(const auto &kv : in.object)
5252
{
5353
if(kv.first == "type")

0 commit comments

Comments
 (0)