Skip to content

Commit fe428ad

Browse files
committed
dfcc_loop_nesting_grapht: cleanup loop includes
Directly refer to the classes rather than going through a series of (member) typedefs and one header that is rather unrelated.
1 parent b96bbeb commit fe428ad

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/goto-instrument/contracts/dynamic-frames/dfcc_cfg_info.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,16 +522,15 @@ dfcc_cfg_infot::dfcc_cfg_infot(
522522
: function_id(function_id),
523523
goto_function(goto_function),
524524
top_level_write_set(top_level_write_set),
525-
log(message_handler),
526525
ns(symbol_table)
527526
{
528527
dfcc_loop_nesting_grapht loop_nesting_graph;
529528
goto_programt &goto_program = goto_function.body;
530-
messaget log(message_handler);
531529
if(loop_contract_mode != dfcc_loop_contract_modet::NONE)
532530
{
531+
messaget log(message_handler);
533532
dfcc_check_loop_normal_form(goto_program, log);
534-
loop_nesting_graph = build_loop_nesting_graph(goto_program, log);
533+
loop_nesting_graph = build_loop_nesting_graph(goto_program);
535534

536535
const auto head = check_inner_loops_have_contracts(loop_nesting_graph);
537536
if(head.has_value())

src/goto-instrument/contracts/dynamic-frames/dfcc_cfg_info.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Date: March 2023
1717
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CFG_INFO_H
1818
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CFG_INFO_H
1919

20-
#include <util/message.h>
2120
#include <util/namespace.h>
2221
#include <util/std_expr.h>
2322
#include <util/symbol_table.h>
@@ -33,6 +32,7 @@ Date: March 2023
3332
class dfcc_utilst;
3433
class dfcc_libraryt;
3534
class goto_functiont;
35+
class message_handlert;
3636

3737
/// \brief Describes a single loop for the purpose of DFCC loop contract
3838
/// instrumentation.
@@ -297,7 +297,6 @@ class dfcc_cfg_infot
297297
const irep_idt &function_id;
298298
goto_functiont &goto_function;
299299
const exprt &top_level_write_set;
300-
messaget log;
301300
const namespacet ns;
302301

303302
/// True iff \p id is in the valid range for a loop id or is equal to

src/goto-instrument/contracts/dynamic-frames/dfcc_loop_nesting_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Date: March 2023
1212

1313
#include "dfcc_loop_nesting_graph.h"
1414

15-
#include <util/invariant.h>
15+
#include <analyses/natural_loops.h>
1616

1717
dfcc_loop_nesting_graph_nodet::dfcc_loop_nesting_graph_nodet(
1818
const goto_programt::targett &head,
1919
const goto_programt::targett &latch,
20-
const loopt &instructions)
20+
const loop_templatet<goto_programt::targett> &instructions)
2121
: head(head), latch(latch), instructions(instructions)
2222
{
2323
}

src/goto-instrument/contracts/dynamic-frames/dfcc_loop_nesting_graph.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Date: March 2023
1818

1919
#include <util/graph.h>
2020

21-
#include <goto-instrument/loop_utils.h>
21+
#include <analyses/loop_analysis.h>
2222

2323
class messaget;
2424

@@ -29,7 +29,7 @@ struct dfcc_loop_nesting_graph_nodet : public graph_nodet<empty_edget>
2929
dfcc_loop_nesting_graph_nodet(
3030
const goto_programt::targett &head,
3131
const goto_programt::targett &latch,
32-
const loopt &instructions);
32+
const loop_templatet<goto_programt::targett> &instructions);
3333

3434
/// Loop head instruction
3535
goto_programt::targett head;
@@ -38,7 +38,7 @@ struct dfcc_loop_nesting_graph_nodet : public graph_nodet<empty_edget>
3838
goto_programt::targett latch;
3939

4040
/// Set of loop instructions
41-
loopt instructions;
41+
loop_templatet<goto_programt::targett> instructions;
4242
};
4343

4444
typedef grapht<dfcc_loop_nesting_graph_nodet> dfcc_loop_nesting_grapht;

0 commit comments

Comments
 (0)