Skip to content

Commit 1d71c5d

Browse files
committed
Make order of arguments in ai_baset::output* consistent
Place the identifier (the name of the function) before the goto program.
1 parent 65a53c2 commit 1d71c5d

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/analyses/ai.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ void ai_baset::output(
3535
out << "////\n";
3636
out << "\n";
3737

38-
output(ns, f_it->second.body, f_it->first, out);
38+
output(ns, f_it->first, f_it->second.body, out);
3939
}
4040
}
4141
}
4242

4343
void ai_baset::output(
4444
const namespacet &ns,
45-
const goto_programt &goto_program,
4645
const irep_idt &identifier,
46+
const goto_programt &goto_program,
4747
std::ostream &out) const
4848
{
4949
forall_goto_program_instructions(i_it, goto_program)
@@ -70,8 +70,8 @@ jsont ai_baset::output_json(
7070
{
7171
if(f_it->second.body_available())
7272
{
73-
result[id2string(f_it->first)]=
74-
output_json(ns, f_it->second.body, f_it->first);
73+
result[id2string(f_it->first)] =
74+
output_json(ns, f_it->first, f_it->second.body);
7575
}
7676
else
7777
{
@@ -90,8 +90,8 @@ jsont ai_baset::output_json(
9090
/// \return The JSON object
9191
jsont ai_baset::output_json(
9292
const namespacet &ns,
93-
const goto_programt &goto_program,
94-
const irep_idt &identifier) const
93+
const irep_idt &identifier,
94+
const goto_programt &goto_program) const
9595
{
9696
json_arrayt contents;
9797

@@ -129,7 +129,7 @@ xmlt ai_baset::output_xml(
129129

130130
if(f_it->second.body_available())
131131
{
132-
function.new_element(output_xml(ns, f_it->second.body, f_it->first));
132+
function.new_element(output_xml(ns, f_it->first, f_it->second.body));
133133
}
134134

135135
program.new_element(function);
@@ -146,8 +146,8 @@ xmlt ai_baset::output_xml(
146146
/// \return The XML object
147147
xmlt ai_baset::output_xml(
148148
const namespacet &ns,
149-
const goto_programt &goto_program,
150-
const irep_idt &identifier) const
149+
const irep_idt &identifier,
150+
const goto_programt &goto_program) const
151151
{
152152
xmlt function_body;
153153

src/analyses/ai.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class ai_baset
145145
const goto_programt &goto_program,
146146
std::ostream &out) const
147147
{
148-
output(ns, goto_program, "", out);
148+
output(ns, "", goto_program, out);
149149
}
150150

151151
/// Output the abstract states for a function
@@ -154,7 +154,7 @@ class ai_baset
154154
const goto_functionst::goto_functiont &goto_function,
155155
std::ostream &out) const
156156
{
157-
output(ns, goto_function.body, "", out);
157+
output(ns, "", goto_function.body, out);
158158
}
159159

160160
/// Output the abstract states for the whole program as JSON
@@ -175,15 +175,15 @@ class ai_baset
175175
const namespacet &ns,
176176
const goto_programt &goto_program) const
177177
{
178-
return output_json(ns, goto_program, "");
178+
return output_json(ns, "", goto_program);
179179
}
180180

181181
/// Output the abstract states for a single function as JSON
182182
jsont output_json(
183183
const namespacet &ns,
184184
const goto_functionst::goto_functiont &goto_function) const
185185
{
186-
return output_json(ns, goto_function.body, "");
186+
return output_json(ns, "", goto_function.body);
187187
}
188188

189189
/// Output the abstract states for the whole program as XML
@@ -204,7 +204,7 @@ class ai_baset
204204
const namespacet &ns,
205205
const goto_programt &goto_program) const
206206
{
207-
return output_xml(ns, goto_program, "");
207+
return output_xml(ns, "", goto_program);
208208
}
209209

210210
/// Output the abstract states for a single function as XML
@@ -259,8 +259,8 @@ class ai_baset
259259
/// \return The JSON object
260260
virtual jsont output_json(
261261
const namespacet &ns,
262-
const goto_programt &goto_program,
263-
const irep_idt &identifier) const;
262+
const irep_idt &identifier,
263+
const goto_programt &goto_program) const;
264264

265265
/// Output the abstract states for a single function as XML
266266
/// \param ns: The namespace
@@ -270,8 +270,8 @@ class ai_baset
270270
/// \return The XML object
271271
virtual xmlt output_xml(
272272
const namespacet &ns,
273-
const goto_programt &goto_program,
274-
const irep_idt &identifier) const;
273+
const irep_idt &identifier,
274+
const goto_programt &goto_program) const;
275275

276276
/// The work queue, sorted by location number
277277
typedef std::map<unsigned, locationt> working_sett;

0 commit comments

Comments
 (0)