@@ -26,9 +26,9 @@ static std::string do_prefix(const std::string &s)
26
26
return s;
27
27
}
28
28
29
- static void irep2name (const irept &irep, std::string &result )
29
+ static std::string irep2name (const irept &irep)
30
30
{
31
- result= " " ;
31
+ std::string result;
32
32
33
33
if (is_reference (static_cast <const typet&>(irep)))
34
34
result+=" reference" ;
@@ -48,7 +48,7 @@ static void irep2name(const irept &irep, std::string &result)
48
48
result+=do_prefix (irep.id_string ());
49
49
50
50
if (irep.get_named_sub ().empty () && irep.get_sub ().empty ())
51
- return ;
51
+ return result ;
52
52
53
53
result+=' (' ;
54
54
bool first=true ;
@@ -64,9 +64,7 @@ static void irep2name(const irept &irep, std::string &result)
64
64
result += do_prefix (name2string (it->first ));
65
65
66
66
result += ' =' ;
67
- std::string tmp;
68
- irep2name (it->second , tmp);
69
- result += tmp;
67
+ result += irep2name (it->second );
70
68
}
71
69
72
70
forall_named_irep (it, irep.get_named_sub ())
@@ -80,9 +78,7 @@ static void irep2name(const irept &irep, std::string &result)
80
78
result+=' ,' ;
81
79
result+=do_prefix (name2string (it->first ));
82
80
result+=' =' ;
83
- std::string tmp;
84
- irep2name (it->second , tmp);
85
- result+=tmp;
81
+ result += irep2name (it->second );
86
82
}
87
83
88
84
forall_irep (it, irep.get_sub ())
@@ -91,12 +87,12 @@ static void irep2name(const irept &irep, std::string &result)
91
87
first=false ;
92
88
else
93
89
result+=' ,' ;
94
- std::string tmp;
95
- irep2name (*it, tmp);
96
- result+=tmp;
90
+ result += irep2name (*it);
97
91
}
98
92
99
93
result+=' )' ;
94
+
95
+ return result;
100
96
}
101
97
102
98
std::string cpp_type2name (const typet &type)
@@ -175,17 +171,13 @@ std::string cpp_type2name(const typet &type)
175
171
else
176
172
{
177
173
// give up
178
- std::string tmp;
179
- irep2name (type, tmp);
180
- return tmp;
174
+ return irep2name (type);
181
175
}
182
176
183
177
return result;
184
178
}
185
179
186
180
std::string cpp_expr2name (const exprt &expr)
187
181
{
188
- std::string tmp;
189
- irep2name (expr, tmp);
190
- return tmp;
182
+ return irep2name (expr);
191
183
}
0 commit comments