Skip to content

Commit b70d8db

Browse files
committed
remove namespacet from does_remove_constt
1 parent 4bc3981 commit b70d8db

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

src/analyses/does_remove_const.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ Author: Diffblue Ltd.
1818

1919
/// A naive analysis to look for casts that remove const-ness from pointers.
2020
/// \param goto_program: the goto program to check
21-
/// \param ns: the namespace of the goto program (used for checking type
22-
/// equality)
23-
does_remove_constt::does_remove_constt(
24-
const goto_programt &goto_program,
25-
const namespacet &ns):
26-
goto_program(goto_program),
27-
ns(ns)
21+
does_remove_constt::does_remove_constt(const goto_programt &goto_program)
22+
: goto_program(goto_program)
2823
{}
2924

3025
/// A naive analysis to look for casts that remove const-ness from pointers.

src/analyses/does_remove_const.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ Author: Diffblue Ltd.
1414
#include <utility>
1515

1616
class goto_programt;
17-
class namespacet;
1817
class exprt;
1918
class source_locationt;
2019
class typet;
2120

2221
class does_remove_constt
2322
{
2423
public:
25-
does_remove_constt(const goto_programt &goto_program, const namespacet &ns);
24+
explicit does_remove_constt(const goto_programt &);
2625
std::pair<bool, source_locationt> operator()() const;
2726

2827
private:
@@ -35,7 +34,6 @@ class does_remove_constt
3534
const typet *target_type, const typet *source_type) const;
3635

3736
const goto_programt &goto_program;
38-
const namespacet &ns;
3937

4038
friend class does_remove_const_testt;
4139
};

src/goto-programs/remove_function_pointers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void remove_function_pointerst::remove_function_pointer(
270270

271271
const exprt &pointer = function.pointer();
272272
remove_const_function_pointerst::functionst functions;
273-
does_remove_constt const_removal_check(goto_program, ns);
273+
does_remove_constt const_removal_check(goto_program);
274274
const auto does_remove_const = const_removal_check();
275275
messaget log{message_handler};
276276
if(does_remove_const.first)

unit/analyses/does_remove_const/does_expr_lose_const.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SCENARIO("does_expr_lose_const",
3030
symbol_tablet symbol_table;
3131
namespacet ns(symbol_table);
3232
goto_programt program;
33-
does_remove_constt does_remove_const(program, ns);
33+
does_remove_constt does_remove_const(program);
3434
does_remove_const_testt does_remove_const_test(does_remove_const);
3535

3636
GIVEN("Const and non-const primitive and pointers to primitives")

unit/analyses/does_remove_const/does_type_preserve_const_correctness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SCENARIO("does_type_preserve_const_correctness",
2929
symbol_tablet symbol_table;
3030
namespacet ns(symbol_table);
3131
goto_programt program;
32-
does_remove_constt does_remove_const(program, ns);
32+
does_remove_constt does_remove_const(program);
3333
does_remove_const_testt does_remove_const_test(does_remove_const);
3434

3535
GIVEN("Const and non-const primitive and pointers to primitives")

unit/analyses/does_remove_const/is_type_at_least_as_const_as.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SCENARIO("is_type_at_least_as_const",
2929
symbol_tablet symbol_table;
3030
namespacet ns(symbol_table);
3131
goto_programt program;
32-
does_remove_constt does_remove_const(program, ns);
32+
does_remove_constt does_remove_const(program);
3333
does_remove_const_testt does_remove_const_test(does_remove_const);
3434

3535
GIVEN("Const and non-const primitive and pointers to primitives")

0 commit comments

Comments
 (0)