Skip to content

Commit 31b59f8

Browse files
author
Daniel Kroening
authored
Merge pull request #793 from mariusmc92/cleanup/rename-type-irep-ids
Added 'C_cxx_alloc_type' irep id
2 parents 985f1a7 + 783de4b commit 31b59f8

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/goto-programs/builtin_functions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void goto_convertt::do_cpp_new(
580580
if(new_array)
581581
new_call.arguments().push_back(count);
582582
new_call.arguments().push_back(object_size);
583-
new_call.set("#type", lhs.type().subtype());
583+
new_call.set(ID_C_cxx_alloc_type, lhs.type().subtype());
584584
new_call.lhs()=tmp_symbol_expr;
585585
new_call.add_source_location()=rhs.source_location();
586586

@@ -612,7 +612,7 @@ void goto_convertt::do_cpp_new(
612612
new_call.arguments().push_back(count);
613613
new_call.arguments().push_back(object_size);
614614
new_call.arguments().push_back(rhs.op0()); // memory location
615-
new_call.set("#type", lhs.type().subtype());
615+
new_call.set(ID_C_cxx_alloc_type, lhs.type().subtype());
616616
new_call.lhs()=tmp_symbol_expr;
617617
new_call.add_source_location()=rhs.source_location();
618618

src/pointer-analysis/value_set.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ void value_sett::get_value_set_rec(
796796
assert(suffix=="");
797797

798798
const typet &dynamic_type=
799-
static_cast<const typet &>(expr.find("#type"));
799+
static_cast<const typet &>(expr.find(ID_C_cxx_alloc_type));
800800

801801
dynamic_object_exprt dynamic_object(dynamic_type);
802802
dynamic_object.set_instance(location_number);

src/pointer-analysis/value_set_fivr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ void value_set_fivrt::get_value_set_rec(
853853
assert(suffix=="");
854854

855855
const typet &dynamic_type=
856-
static_cast<const typet &>(expr.find("#type"));
856+
static_cast<const typet &>(expr.find(ID_C_cxx_alloc_type));
857857

858858
dynamic_object_exprt dynamic_object(dynamic_type);
859859
// let's make up a `unique' number for this object...

src/pointer-analysis/value_set_fivrns.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ void value_set_fivrnst::get_value_set_rec(
627627
assert(suffix=="");
628628

629629
const typet &dynamic_type=
630-
static_cast<const typet &>(expr.find("#type"));
630+
static_cast<const typet &>(expr.find(ID_C_cxx_alloc_type));
631631

632632
dynamic_object_exprt dynamic_object(dynamic_type);
633633
// let's make up a `unique' number for this object...

src/util/irep_ids.def

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ IREP_ID_ONE(main)
205205
IREP_ID_ONE(expression)
206206
IREP_ID_ONE(free)
207207
IREP_ID_ONE(malloc)
208+
IREP_ID_TWO(C_cxx_alloc_type, #cxx_alloc_type)
208209
IREP_ID_ONE(cpp_new)
209210
IREP_ID_ONE(cpp_delete)
210211
IREP_ID_TWO(cpp_new_array, cpp_new[])

0 commit comments

Comments
 (0)