Skip to content

Commit 99260e4

Browse files
Use format instead of from_expr in value_sett output
This avoids having to provide a namespace argument and having a default language defined.
1 parent f00ff54 commit 99260e4

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Author: Daniel Kroening, [email protected]
2323
#include <langapi/language_util.h>
2424
#include <util/range.h>
2525
#include <goto-symex/renamed.h>
26+
#include <util/format_expr.h>
27+
#include <util/format_type.h>
2628

2729
#ifdef DEBUG
2830
#include <iostream>
@@ -134,7 +136,7 @@ bool value_sett::insert(
134136
}
135137

136138
void value_sett::output(
137-
const namespacet &ns,
139+
const namespacet &,
138140
std::ostream &out,
139141
const std::string &indent) const
140142
{
@@ -175,29 +177,29 @@ void value_sett::output(
175177
{
176178
const exprt &o = object_numbering[o_it->first];
177179

178-
std::string result;
180+
std::ostringstream stream;
179181

180182
if(o.id() == ID_invalid || o.id() == ID_unknown)
181-
result = from_expr(ns, identifier, o);
183+
stream << format(o);
182184
else
183185
{
184-
result = "<" + from_expr(ns, identifier, o) + ", ";
186+
stream << "<" << format(o) << ", ";
185187

186188
if(o_it->second)
187-
result += integer2string(*o_it->second);
189+
stream << *o_it->second;
188190
else
189-
result += '*';
191+
stream << '*';
190192

191193
if(o.type().is_nil())
192-
result += ", ?";
194+
stream << ", ?";
193195
else
194-
result += ", " + from_type(ns, identifier, o.type());
196+
stream << ", " << format(o.type());
195197

196-
result += '>';
198+
stream << '>';
197199
}
198200

201+
const std::string result = stream.str();
199202
out << result;
200-
201203
width += result.size();
202204

203205
object_map_dt::const_iterator next(o_it);

0 commit comments

Comments
 (0)