Skip to content

Add missing #include <cassert> #6757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ansi-c/c_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Author: Daniel Kroening, [email protected]
/// \file
/// ANSI-C Language Type Checking

#include "c_typecheck_base.h"

#include <sstream>

#include <util/arith_tools.h>
#include <util/bitvector_expr.h>
#include <util/c_types.h>
Expand All @@ -39,10 +35,14 @@ Author: Daniel Kroening, [email protected]
#include "builtin_factory.h"
#include "c_expr.h"
#include "c_qualifiers.h"
#include "c_typecheck_base.h"
#include "expr2c.h"
#include "padding.h"
#include "type2name.h"

#include <cassert>
#include <sstream>

void c_typecheck_baset::typecheck_expr(exprt &expr)
{
if(expr.id()==ID_already_typechecked)
Expand Down
2 changes: 2 additions & 0 deletions src/ansi-c/c_typecheck_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Author: Daniel Kroening, [email protected]
#include "c_typecheck_base.h"
#include "type2name.h"

#include <cassert>

void c_typecheck_baset::do_initializer(
exprt &initializer,
const typet &type,
Expand Down
12 changes: 6 additions & 6 deletions src/ansi-c/c_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Type Checking

#include "c_typecheck_base.h"

#include <unordered_set>

#include <goto-programs/goto_instruction_code.h>

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/config.h>
Expand All @@ -24,14 +18,20 @@ Author: Daniel Kroening, [email protected]
#include <util/pointer_offset_size.h>
#include <util/simplify_expr.h>

#include <goto-programs/goto_instruction_code.h>

#include "ansi_c_convert_type.h"
#include "ansi_c_declaration.h"
#include "c_qualifiers.h"
#include "c_typecheck_base.h"
#include "gcc_types.h"
#include "padding.h"
#include "type2name.h"
#include "typedef_type.h"

#include <cassert>
#include <unordered_set>

void c_typecheck_baset::typecheck_type(typet &type)
{
// we first convert, and then check
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/cpp_instantiate_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Author: Daniel Kroening, [email protected]

#include "cpp_type2name.h"

#include <cassert>

std::string cpp_typecheckt::template_suffix(
const cpp_template_args_tct &template_args)
{
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/cpp_typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Author: Daniel Kroening, [email protected]

#include "cpp_typecheck.h"

#include <algorithm>

#include <util/pointer_expr.h>
#include <util/source_location.h>
#include <util/symbol.h>
Expand All @@ -23,6 +21,9 @@ Author: Daniel Kroening, [email protected]
#include "cpp_util.h"
#include "expr2cpp.h"

#include <algorithm>
#include <cassert>

void cpp_typecheckt::convert(cpp_itemt &item)
{
if(item.is_declaration())
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/cpp_typecheck_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <util/arith_tools.h>
#include <util/bitvector_expr.h>
#include <util/pointer_expr.h>
#include <util/source_location.h>

#include "cpp_declarator_converter.h"
#include "cpp_exception_id.h"
#include "cpp_typecheck.h"
#include "cpp_typecheck_fargs.h"
#include "cpp_util.h"

#include <cassert>

void cpp_typecheckt::typecheck_code(codet &code)
{
const irep_idt &statement=code.get_statement();
Expand Down
7 changes: 4 additions & 3 deletions src/cpp/cpp_typecheck_compound_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ Author: Daniel Kroening, [email protected]
#include <iostream>
#endif

#include <algorithm>

#include <util/arith_tools.h>
#include <util/std_types.h>
#include <util/c_types.h>
#include <util/std_types.h>

#include <ansi-c/c_qualifiers.h>

Expand All @@ -28,6 +26,9 @@ Author: Daniel Kroening, [email protected]
#include "cpp_type2name.h"
#include "cpp_util.h"

#include <algorithm>
#include <cassert>

bool cpp_typecheckt::has_const(const typet &type)
{
if(type.id()==ID_const)
Expand Down
10 changes: 6 additions & 4 deletions src/cpp/cpp_typecheck_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <goto-programs/goto_instruction_code.h>

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/pointer_expr.h>
#include <util/std_code.h>

#include <goto-programs/goto_instruction_code.h>

#include "cpp_typecheck.h"

#include <cassert>

/// Generate code to copy the parent.
/// \param source_location: location for generated code
/// \param parent_base_name: base name of typechecked parent
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/cpp_typecheck_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Module: C++ Language Type Checking
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/config.h>
Expand All @@ -21,8 +19,11 @@ Module: C++ Language Type Checking

#include <ansi-c/c_qualifiers.h>

#include "cpp_typecheck.h"
#include "cpp_util.h"

#include <cassert>

/// Lvalue-to-rvalue conversion
///
/// An lvalue (3.10) of a non-function, non-array type T can be
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/cpp_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Author: Daniel Kroening, [email protected]
#include "cpp_util.h"
#include "expr2cpp.h"

#include <cassert>

bool cpp_typecheckt::find_parent(
const symbolt &symb,
const irep_idt &base_name,
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/cpp_typecheck_resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Author: Daniel Kroening, [email protected]
#include <iostream>
#endif

#include <algorithm>

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/mathematical_types.h>
Expand All @@ -34,6 +32,9 @@ Author: Daniel Kroening, [email protected]
#include "cpp_typecheck_fargs.h"
#include "cpp_util.h"

#include <algorithm>
#include <cassert>

cpp_typecheck_resolvet::cpp_typecheck_resolvet(cpp_typecheckt &_cpp_typecheck):
cpp_typecheck(_cpp_typecheck),
original_scope(nullptr) // set in resolve_scope()
Expand Down
11 changes: 6 additions & 5 deletions src/cpp/cpp_typecheck_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <util/base_exceptions.h>
#include <util/simplify_expr.h>

#include "cpp_type2name.h"
#include "cpp_declarator_converter.h"
#include "cpp_template_type.h"
#include "cpp_convert_type.h"
#include "cpp_declarator_converter.h"
#include "cpp_template_args.h"
#include "cpp_template_type.h"
#include "cpp_type2name.h"
#include "cpp_typecheck.h"

#include <cassert>

void cpp_typecheckt::salvage_default_arguments(
const template_typet &old_type,
Expand Down
9 changes: 5 additions & 4 deletions src/cpp/cpp_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <util/source_location.h>
#include <util/simplify_expr.h>
#include <util/c_types.h>
#include <util/simplify_expr.h>
#include <util/source_location.h>

#include <ansi-c/c_qualifiers.h>

#include "cpp_convert_type.h"
#include "cpp_typecheck.h"
#include "cpp_typecheck_fargs.h"

#include <cassert>

void cpp_typecheckt::typecheck_type(typet &type)
{
assert(!type.id().empty());
Expand Down
12 changes: 6 additions & 6 deletions src/cpp/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ Author: Daniel Kroening, [email protected]
/// \file
/// C++ Language Parsing

#include "cpp_parser.h"

#include <map>

#include <util/c_types.h>
#include <util/std_code.h>

#include <ansi-c/ansi_c_y.tab.h>
#include <ansi-c/merged_type.h>

#include "cpp_token_buffer.h"
#include "cpp_member_spec.h"
#include "cpp_enum_type.h"
#include "cpp_member_spec.h"
#include "cpp_parser.h"
#include "cpp_token_buffer.h"

#include <cassert>
#include <map>

#ifdef DEBUG
#include <iostream>
Expand Down
5 changes: 3 additions & 2 deletions src/goto-diff/change_impact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ Date: April 2016

#include "change_impact.h"

#include <iostream>

#include <goto-programs/goto_model.h>

#include <analyses/dependence_graph.h>

#include "unified_diff.h"

#include <cassert>
#include <iostream>

#if 0
struct cfg_nodet
{
Expand Down
5 changes: 3 additions & 2 deletions src/goto-instrument/goto_program2code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Author: Daniel Kroening, [email protected]

#include "goto_program2code.h"

#include <sstream>

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/expr_util.h>
Expand All @@ -21,6 +19,9 @@ Author: Daniel Kroening, [email protected]
#include <util/prefix.h>
#include <util/simplify_expr.h>

#include <cassert>
#include <sstream>

void goto_program2codet::operator()()
{
// labels stored for cleanup
Expand Down
8 changes: 5 additions & 3 deletions src/goto-instrument/k_induction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ Author: Daniel Kroening, [email protected]

#include "k_induction.h"

#include <analyses/natural_loops.h>
#include <analyses/local_may_alias.h>

#include <goto-programs/remove_skip.h>

#include <analyses/local_may_alias.h>
#include <analyses/natural_loops.h>

#include "havoc_utils.h"
#include "loop_utils.h"
#include "unwind.h"

#include <cassert>

class k_inductiont
{
public:
Expand Down
2 changes: 2 additions & 0 deletions src/goto-instrument/unwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Author: Daniel Kroening, [email protected]

#include "unwindset.h"

#include <cassert>

void goto_unwindt::copy_segment(
const goto_programt::const_targett start,
const goto_programt::const_targett end, // exclusive
Expand Down
4 changes: 3 additions & 1 deletion src/goto-instrument/wmm/cycle_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Date: 2012
/// \file
/// collection of cycles in graph of abstract events

#include <util/message.h>

#include "event_graph.h"

#include <util/message.h>
#include <cassert>

/// after the collection, eliminates the executions forbidden by an indirect
/// thin-air
Expand Down
1 change: 1 addition & 0 deletions src/goto-instrument/wmm/event_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Date: 2012

#include <util/message.h>

#include <cassert>
#include <fstream>


Expand Down
12 changes: 6 additions & 6 deletions src/goto-instrument/wmm/goto2graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Date: 2012

#include "goto2graph.h"

#include <vector>
#include <string>
#include <fstream>

#include <util/options.h>
#include <util/prefix.h>

#include <linking/static_lifetime_init.h>

#include <goto-instrument/rw_set.h>
#include <linking/static_lifetime_init.h>

#include "fence.h"

#include <cassert>
#include <fstream>
#include <string>
#include <vector>

// #define PRINT_UNSAFES


Expand Down