Skip to content

Commit 032a284

Browse files
authored
Merge pull request #5815 from tautschnig/componentt
Make componentt::{base,pretty}_name comments
2 parents 3777fa9 + 8e4f8e3 commit 032a284

File tree

10 files changed

+20
-14
lines changed

10 files changed

+20
-14
lines changed

Diff for: regression/ansi-c/arch_flags_mcpu_bad/object.intel

35 Bytes
Binary file not shown.

Diff for: regression/ansi-c/arch_flags_mcpu_good/object.arm

35 Bytes
Binary file not shown.

Diff for: regression/ansi-c/arch_flags_mthumb_bad/object.intel

35 Bytes
Binary file not shown.

Diff for: regression/ansi-c/arch_flags_mthumb_good/object.arm

35 Bytes
Binary file not shown.

Diff for: src/ansi-c/expr2c.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -1564,13 +1564,13 @@ std::string expr2ct::convert_member(
15641564

15651565
if(!component_name.empty())
15661566
{
1567-
const exprt &comp_expr = struct_union_type.get_component(component_name);
1567+
const auto &comp_expr = struct_union_type.get_component(component_name);
15681568

15691569
if(comp_expr.is_nil())
15701570
return convert_norep(src, precedence);
15711571

1572-
if(!comp_expr.get(ID_pretty_name).empty())
1573-
dest+=comp_expr.get_string(ID_pretty_name);
1572+
if(!comp_expr.get_pretty_name().empty())
1573+
dest += id2string(comp_expr.get_pretty_name());
15741574
else
15751575
dest+=id2string(component_name);
15761576

@@ -1582,9 +1582,12 @@ std::string expr2ct::convert_member(
15821582
if(n>=struct_union_type.components().size())
15831583
return convert_norep(src, precedence);
15841584

1585-
const exprt &comp_expr = struct_union_type.components()[n];
1585+
const auto &comp_expr = struct_union_type.components()[n];
15861586

1587-
dest+=comp_expr.get_string(ID_pretty_name);
1587+
if(!comp_expr.get_pretty_name().empty())
1588+
dest += id2string(comp_expr.get_pretty_name());
1589+
else
1590+
dest += id2string(comp_expr.get_name());
15881591

15891592
return dest;
15901593
}

Diff for: src/cpp/expr2cpp.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ std::string expr2cppt::convert_struct(
9696

9797
dest+=sep;
9898
dest+='.';
99-
dest += c.get_string(ID_pretty_name);
99+
if(!c.get_pretty_name().empty())
100+
dest += id2string(c.get_pretty_name());
101+
else
102+
dest += id2string(c.get_name());
100103
dest+='=';
101104
dest+=tmp;
102105
}

Diff for: src/goto-instrument/alignment_checks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void print_struct_alignment_problems(
8181
<< symbol_pair.second.location << '\n';
8282
}
8383

84-
out << "members " << it_mem->get_pretty_name() << " and "
85-
<< it_next->get_pretty_name() << " might interfere\n";
84+
out << "members " << it_mem->get_name() << " and "
85+
<< it_next->get_name() << " might interfere\n";
8686
}
8787
}
8888
}

Diff for: src/goto-programs/write_goto_binary.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Author: CM Wintersteiger
1212
#ifndef CPROVER_GOTO_PROGRAMS_WRITE_GOTO_BINARY_H
1313
#define CPROVER_GOTO_PROGRAMS_WRITE_GOTO_BINARY_H
1414

15-
#define GOTO_BINARY_VERSION 5
15+
#define GOTO_BINARY_VERSION 6
1616

1717
#include <iosfwd>
1818
#include <string>

Diff for: src/util/irep_ids.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ IREP_ID_TWO(mult, *)
353353
IREP_ID_TWO(div, /)
354354
IREP_ID_TWO(power, **)
355355
IREP_ID_ONE(factorial_power)
356-
IREP_ID_ONE(pretty_name)
356+
IREP_ID_TWO(C_pretty_name, #pretty_name)
357357
IREP_ID_TWO(C_class, #class)
358358
IREP_ID_TWO(C_field, #field)
359359
IREP_ID_TWO(C_interface, #interface)

Diff for: src/util/std_types.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ class struct_union_typet:public typet
8888

8989
const irep_idt &get_base_name() const
9090
{
91-
return get(ID_base_name);
91+
return get(ID_C_base_name);
9292
}
9393

9494
void set_base_name(const irep_idt &base_name)
9595
{
96-
return set(ID_base_name, base_name);
96+
return set(ID_C_base_name, base_name);
9797
}
9898

9999
const irep_idt &get_access() const
@@ -108,12 +108,12 @@ class struct_union_typet:public typet
108108

109109
const irep_idt &get_pretty_name() const
110110
{
111-
return get(ID_pretty_name);
111+
return get(ID_C_pretty_name);
112112
}
113113

114114
void set_pretty_name(const irep_idt &name)
115115
{
116-
return set(ID_pretty_name, name);
116+
return set(ID_C_pretty_name, name);
117117
}
118118

119119
bool get_anonymous() const

0 commit comments

Comments
 (0)