Skip to content

Commit 94cacf4

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 7bf4f74 commit 94cacf4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
analyses
22
goto-programs
3-
langapi # should go away
43
pointer-analysis
54
util

src/pointer-analysis/value_set.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/prefix.h>
2121
#include <util/simplify_expr.h>
2222

23-
#include <langapi/language_util.h>
2423
#include <util/range.h>
24+
#include <util/format_expr.h>
25+
#include <util/format_type.h>
2526

2627
#ifdef DEBUG
2728
#include <iostream>
@@ -133,7 +134,7 @@ bool value_sett::insert(
133134
}
134135

135136
void value_sett::output(
136-
const namespacet &ns,
137+
const namespacet &,
137138
std::ostream &out,
138139
const std::string &indent) const
139140
{
@@ -174,29 +175,29 @@ void value_sett::output(
174175
{
175176
const exprt &o = object_numbering[o_it->first];
176177

177-
std::string result;
178+
std::ostringstream stream;
178179

179180
if(o.id() == ID_invalid || o.id() == ID_unknown)
180-
result = from_expr(ns, identifier, o);
181+
stream << format(o);
181182
else
182183
{
183-
result = "<" + from_expr(ns, identifier, o) + ", ";
184+
stream << "<" << format(o) << ", ";
184185

185186
if(o_it->second)
186-
result += integer2string(*o_it->second);
187+
stream << *o_it->second;
187188
else
188-
result += '*';
189+
stream << '*';
189190

190191
if(o.type().is_nil())
191-
result += ", ?";
192+
stream << ", ?";
192193
else
193-
result += ", " + from_type(ns, identifier, o.type());
194+
stream << ", " << format(o.type());
194195

195-
result += '>';
196+
stream << '>';
196197
}
197198

199+
const std::string result = stream.str();
198200
out << result;
199-
200201
width += result.size();
201202

202203
object_map_dt::const_iterator next(o_it);

0 commit comments

Comments
 (0)