forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename zero_initializer to expr_initializer in preparation of general…
…isation
- Loading branch information
1 parent
bc15b1b
commit 626fb98
Showing
19 changed files
with
42 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,10 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/namespace.h> | ||
#include <util/std_expr.h> | ||
#include <util/suffix.h> | ||
#include <util/zero_initializer.h> | ||
|
||
class java_bytecode_convert_classt:public messaget | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,14 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/ieee_float.h> | ||
#include <util/invariant.h> | ||
#include <util/namespace.h> | ||
#include <util/prefix.h> | ||
#include <util/simplify_expr.h> | ||
#include <util/std_expr.h> | ||
#include <util/string2int.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <goto-programs/cfg.h> | ||
#include <goto-programs/class_hierarchy.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ Author: Daniel Kroening, [email protected] | |
#include "java_bytecode_typecheck.h" | ||
|
||
#include <util/arith_tools.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/unicode.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include "java_pointer_casts.h" | ||
#include "java_types.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,10 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "java_object_factory.h" | ||
|
||
#include <util/expr_initializer.h> | ||
#include <util/fresh_symbol.h> | ||
#include <util/nondet_bool.h> | ||
#include <util/pointer_offset_size.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <goto-programs/class_identifier.h> | ||
#include <goto-programs/goto_functions.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,9 @@ Author: Chris Smowton, [email protected] | |
#include "java_utils.h" | ||
|
||
#include <util/arith_tools.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/namespace.h> | ||
#include <util/unicode.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <iomanip> | ||
#include <sstream> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Author: Daniel Kroening, [email protected] | |
#include "c_typecheck_base.h" | ||
|
||
#include <util/config.h> | ||
#include <util/zero_initializer.h> | ||
#include <util/expr_initializer.h> | ||
|
||
#include "ansi_c_declaration.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,12 @@ Author: Daniel Kroening, [email protected] | |
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/cprover_prefix.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/prefix.h> | ||
#include <util/simplify_expr.h> | ||
#include <util/std_types.h> | ||
#include <util/string_constant.h> | ||
#include <util/type_eq.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include "anonymous_member.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,9 @@ Author: Daniel Kroening, [email protected] | |
#include <algorithm> | ||
|
||
#include <util/arith_tools.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/source_location.h> | ||
#include <util/symbol.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <ansi-c/c_typecast.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ Author: Daniel Kroening, [email protected] | |
#include <util/base_type.h> | ||
#include <util/c_types.h> | ||
#include <util/config.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/pointer_offset_size.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <ansi-c/c_qualifiers.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/pointer_offset_size.h> | ||
#include <util/zero_initializer.h> | ||
|
||
/// Initialize an object with a value | ||
void cpp_typecheckt::convert_initializer(symbolt &symbol) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ Author: Kareem Khazem <[email protected]>, 2017 | |
|
||
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/magic.h> | ||
#include <util/run.h> | ||
#include <util/tempfile.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <json/json_parser.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,10 @@ Author: Daniel Kroening, [email protected] | |
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/cprover_prefix.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/pointer_offset_size.h> | ||
#include <util/rational.h> | ||
#include <util/rational_tools.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <langapi/language_util.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/invariant_utils.h> | ||
#include <util/pointer_offset_size.h> | ||
#include <util/simplify_expr.h> | ||
#include <util/string2int.h> | ||
#include <util/zero_initializer.h> | ||
|
||
inline static typet c_sizeof_type_rec(const exprt &expr) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "goto_symex.h" | ||
|
||
#include <util/zero_initializer.h> | ||
#include <util/expr_initializer.h> | ||
|
||
void goto_symext::symex_start_thread(statet &state) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ Author: Daniel Kroening, [email protected] | |
#include <util/arith_tools.h> | ||
#include <util/c_types.h> | ||
#include <util/config.h> | ||
#include <util/expr_initializer.h> | ||
#include <util/namespace.h> | ||
#include <util/prefix.h> | ||
#include <util/std_code.h> | ||
#include <util/std_expr.h> | ||
#include <util/zero_initializer.h> | ||
|
||
#include <goto-programs/goto_functions.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
/*******************************************************************\ | ||
Module: Zero Initialization | ||
Module: Expression Initialization | ||
Author: Daniel Kroening, [email protected] | ||
\*******************************************************************/ | ||
|
||
/// \file | ||
/// Zero Initialization | ||
/// Expression Initialization | ||
|
||
#include "zero_initializer.h" | ||
#include "expr_initializer.h" | ||
|
||
#include "arith_tools.h" | ||
#include "c_types.h" | ||
|
@@ -20,10 +20,10 @@ Author: Daniel Kroening, [email protected] | |
#include "pointer_offset_size.h" | ||
#include "std_expr.h" | ||
|
||
class zero_initializert:public messaget | ||
class expr_initializert : public messaget | ||
{ | ||
public: | ||
zero_initializert( | ||
expr_initializert( | ||
const namespacet &_ns, | ||
message_handlert &_message_handler): | ||
messaget(_message_handler), | ||
|
@@ -35,18 +35,18 @@ class zero_initializert:public messaget | |
const typet &type, | ||
const source_locationt &source_location) | ||
{ | ||
return zero_initializer_rec(type, source_location); | ||
return expr_initializer_rec(type, source_location); | ||
} | ||
|
||
protected: | ||
const namespacet &ns; | ||
|
||
exprt zero_initializer_rec( | ||
exprt expr_initializer_rec( | ||
const typet &type, | ||
const source_locationt &source_location); | ||
}; | ||
|
||
exprt zero_initializert::zero_initializer_rec( | ||
exprt expr_initializert::expr_initializer_rec( | ||
const typet &type, | ||
const source_locationt &source_location) | ||
{ | ||
|
@@ -86,7 +86,7 @@ exprt zero_initializert::zero_initializer_rec( | |
} | ||
else if(type_id==ID_complex) | ||
{ | ||
exprt sub_zero=zero_initializer_rec(type.subtype(), source_location); | ||
exprt sub_zero = expr_initializer_rec(type.subtype(), source_location); | ||
complex_exprt result(sub_zero, sub_zero, to_complex_type(type)); | ||
result.add_source_location()=source_location; | ||
return result; | ||
|
@@ -113,7 +113,8 @@ exprt zero_initializert::zero_initializer_rec( | |
} | ||
else | ||
{ | ||
exprt tmpval=zero_initializer_rec(array_type.subtype(), source_location); | ||
exprt tmpval = | ||
expr_initializer_rec(array_type.subtype(), source_location); | ||
|
||
mp_integer array_size; | ||
|
||
|
@@ -148,7 +149,7 @@ exprt zero_initializert::zero_initializer_rec( | |
{ | ||
const vector_typet &vector_type=to_vector_type(type); | ||
|
||
exprt tmpval=zero_initializer_rec(vector_type.subtype(), source_location); | ||
exprt tmpval = expr_initializer_rec(vector_type.subtype(), source_location); | ||
|
||
mp_integer vector_size; | ||
|
||
|
@@ -195,7 +196,7 @@ exprt zero_initializert::zero_initializer_rec( | |
} | ||
else | ||
value.copy_to_operands( | ||
zero_initializer_rec(it->type(), source_location)); | ||
expr_initializer_rec(it->type(), source_location)); | ||
} | ||
|
||
value.add_source_location()=source_location; | ||
|
@@ -245,14 +246,14 @@ exprt zero_initializert::zero_initializer_rec( | |
{ | ||
value.set_component_name(component.get_name()); | ||
value.op()= | ||
zero_initializer_rec(component.type(), source_location); | ||
expr_initializer_rec(component.type(), source_location); | ||
} | ||
|
||
return value; | ||
} | ||
else if(type_id==ID_symbol) | ||
{ | ||
exprt result=zero_initializer_rec(ns.follow(type), source_location); | ||
exprt result = expr_initializer_rec(ns.follow(type), source_location); | ||
// we might have mangled the type for arrays, so keep that | ||
if(ns.follow(type).id()!=ID_array) | ||
result.type()=type; | ||
|
@@ -262,21 +263,21 @@ exprt zero_initializert::zero_initializer_rec( | |
else if(type_id==ID_c_enum_tag) | ||
{ | ||
return | ||
zero_initializer_rec( | ||
expr_initializer_rec( | ||
ns.follow_tag(to_c_enum_tag_type(type)), | ||
source_location); | ||
} | ||
else if(type_id==ID_struct_tag) | ||
{ | ||
return | ||
zero_initializer_rec( | ||
expr_initializer_rec( | ||
ns.follow_tag(to_struct_tag_type(type)), | ||
source_location); | ||
} | ||
else if(type_id==ID_union_tag) | ||
{ | ||
return | ||
zero_initializer_rec( | ||
expr_initializer_rec( | ||
ns.follow_tag(to_union_tag_type(type)), | ||
source_location); | ||
} | ||
|
@@ -298,7 +299,7 @@ exprt zero_initializer( | |
const namespacet &ns, | ||
message_handlert &message_handler) | ||
{ | ||
zero_initializert z_i(ns, message_handler); | ||
expr_initializert z_i(ns, message_handler); | ||
return z_i(type, source_location); | ||
} | ||
|
||
|
@@ -312,7 +313,7 @@ exprt zero_initializer( | |
|
||
try | ||
{ | ||
zero_initializert z_i(ns, mh); | ||
expr_initializert z_i(ns, mh); | ||
return z_i(type, source_location); | ||
} | ||
catch(int) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/*******************************************************************\ | ||
Module: Zero Initialization | ||
Module: Expression Initialization | ||
Author: Daniel Kroening, [email protected] | ||
\*******************************************************************/ | ||
|
||
/// \file | ||
/// Zero Initialization | ||
/// Expression Initialization | ||
|
||
#ifndef CPROVER_UTIL_ZERO_INITIALIZER_H | ||
#define CPROVER_UTIL_ZERO_INITIALIZER_H | ||
#ifndef CPROVER_UTIL_EXPR_INITIALIZER_H | ||
#define CPROVER_UTIL_EXPR_INITIALIZER_H | ||
|
||
#include "expr.h" | ||
|
||
|
@@ -30,4 +30,4 @@ exprt zero_initializer( | |
const source_locationt &, | ||
const namespacet &); | ||
|
||
#endif // CPROVER_UTIL_ZERO_INITIALIZER_H | ||
#endif // CPROVER_UTIL_EXPR_INITIALIZER_H |