Skip to content

Commit 85cb6dc

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Use code_blockt's constructor
Don't construct the irept by hand.
1 parent 1f9d908 commit 85cb6dc

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/cpp/cpp_typecheck_constructor.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ void cpp_typecheckt::default_ctor(
128128
decl.type().subtype().make_nil();
129129
decl.add_source_location()=source_location;
130130

131-
decl.value().id(ID_code);
132-
decl.value().type()=typet(ID_code);
133-
decl.value().set(ID_statement, ID_block);
131+
decl.value() = code_blockt();
134132
decl.add(ID_cv).make_nil();
135133
decl.add(ID_throw_decl).make_nil();
136134

src/cpp/cpp_typecheck_destructor.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ void cpp_typecheckt::default_dtor(
3737
decl.type().id(ID_function_type);
3838
decl.type().subtype().make_nil();
3939

40-
decl.value().id(ID_code);
41-
decl.value().add(ID_type).id(ID_code);
42-
decl.value().set(ID_statement, ID_block);
40+
decl.value() = code_blockt();
4341
decl.add(ID_cv).make_nil();
4442
decl.add(ID_throw_decl).make_nil();
4543

0 commit comments

Comments
 (0)