Skip to content

Commit 5f7ff99

Browse files
author
Daniel Kroening
authored
Merge pull request #890 from reuk/include-order-fix
Include order fix
2 parents d80b10e + 8352163 commit 5f7ff99

File tree

582 files changed

+978
-938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

582 files changed

+978
-938
lines changed

CODING_STANDARD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ Here a few minimalistic coding rules for the CPROVER source tree.
103103
- Prefer forward declaration to includes, but forward declare at the top of the
104104
header file rather than in line
105105
- Guard headers with `#ifndef CPROVER_DIRECTORIES_FILE_H`, etc
106+
- The corresponding header for a given source file should always be the *first*
107+
include in the source file. For example, given `foo.h` and `foo.cpp`, the
108+
line `#include "foo.h"` should precede all other include statements in
109+
`foo.cpp`.
106110
107111
# Makefiles
108112
- Each source file should appear on a separate line

src/analyses/ai.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Abstract Interpretation
1111

12+
#include "ai.h"
13+
1214
#include <cassert>
1315
#include <memory>
1416
#include <sstream>
@@ -19,8 +21,6 @@ Author: Daniel Kroening, [email protected]
1921

2022
#include "is_threaded.h"
2123

22-
#include "ai.h"
23-
2424
jsont ai_domain_baset::output_json(
2525
const ai_baset &ai,
2626
const namespacet &ns) const

src/analyses/call_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Function Call Graphs
1111

12+
#include "call_graph.h"
13+
1214
#include <util/std_expr.h>
1315
#include <util/xml.h>
1416

15-
#include "call_graph.h"
16-
1717
call_grapht::call_grapht()
1818
{
1919
}

src/analyses/constant_propagator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Author: Peter Schrammel
99
/// \file
1010
/// Constant Propagation
1111

12+
#include "constant_propagator.h"
13+
1214
#ifdef DEBUG
1315
#include <iostream>
1416
#endif
@@ -17,8 +19,6 @@ Author: Peter Schrammel
1719
#include <util/arith_tools.h>
1820
#include <util/simplify_expr.h>
1921

20-
#include "constant_propagator.h"
21-
2222
exprt concatenate_array_id(
2323
const exprt &array, const exprt &index,
2424
const typet &type)

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Field-insensitive, location-sensitive bitvector analysis
1111

12+
#include "custom_bitvector_analysis.h"
13+
1214
#include <util/xml_expr.h>
1315
#include <util/simplify_expr.h>
1416

15-
#include "custom_bitvector_analysis.h"
16-
1717
#include <iostream>
1818

1919
void custom_bitvector_domaint::set_bit(

src/analyses/dependence_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Date: August 2013
1212
/// \file
1313
/// Field-Sensitive Program Dependence Analysis, Litvak et al., FSE 2010
1414

15+
#include "dependence_graph.h"
16+
1517
#include <cassert>
1618

1719
#include <util/json.h>
1820
#include <util/json_expr.h>
1921

2022
#include "goto_rw.h"
2123

22-
#include "dependence_graph.h"
23-
2424
bool dep_graph_domaint::merge(
2525
const dep_graph_domaint &src,
2626
goto_programt::const_targett from,

src/analyses/dirty.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Date: March 2013
1111
/// \file
1212
/// Local variables whose address is taken
1313

14-
#include <util/std_expr.h>
15-
1614
#include "dirty.h"
1715

16+
#include <util/std_expr.h>
17+
1818
void dirtyt::build(const goto_functiont &goto_function)
1919
{
2020
forall_goto_program_instructions(it, goto_function.body)

src/analyses/does_remove_const.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
/// \file
1010
/// Analyses
1111

12+
#include "does_remove_const.h"
13+
1214
#include <goto-programs/goto_program.h>
1315
#include <util/type.h>
1416
#include <util/expr.h>
1517
#include <util/std_code.h>
1618
#include <util/base_type.h>
1719
#include <ansi-c/c_qualifiers.h>
1820

19-
#include "does_remove_const.h"
20-
2121
/// A naive analysis to look for casts that remove const-ness from pointers.
2222
/// \param goto_program: the goto program to check
2323
/// \param ns: the namespace of the goto program (used for checking type

src/analyses/does_remove_const.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include <util/type.h>
1515

1616
class goto_programt;
17+
class namespacet;
18+
class exprt;
1719

1820
class does_remove_constt
1921
{

src/analyses/escape_analysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Field-insensitive, location-sensitive escape analysis
1111

12-
#include <util/simplify_expr.h>
13-
1412
#include "escape_analysis.h"
1513

14+
#include <util/simplify_expr.h>
15+
1616
bool escape_domaint::is_tracked(const symbol_exprt &symbol)
1717
{
1818
const irep_idt &identifier=symbol.get_identifier();

0 commit comments

Comments
 (0)