File tree 3 files changed +6
-18
lines changed
3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 16
16
#include < util/expr.h>
17
17
#include < util/std_code.h>
18
18
#include < util/base_type.h>
19
- #include < ansi-c/c_qualifiers.h>
20
19
21
20
// / A naive analysis to look for casts that remove const-ness from pointers.
22
21
// / \param goto_program: the goto program to check
@@ -163,8 +162,6 @@ bool does_remove_constt::does_type_preserve_const_correctness(
163
162
bool does_remove_constt::is_type_at_least_as_const_as (
164
163
const typet &type_more_const, const typet &type_compare) const
165
164
{
166
- const c_qualifierst type_compare_qualifiers (type_compare);
167
- const c_qualifierst more_constant_qualifiers (type_more_const);
168
- return !type_compare_qualifiers.is_constant ||
169
- more_constant_qualifiers.is_constant ;
165
+ return !type_compare.get_bool (ID_C_constant) ||
166
+ type_more_const.get_bool (ID_C_constant);
170
167
}
Original file line number Diff line number Diff line change 1
1
analyses
2
- ansi-c # should go away
3
2
goto-programs
4
3
langapi # should go away
5
4
pointer-analysis
Original file line number Diff line number Diff line change 16
16
#include < util/std_expr.h>
17
17
#include < util/symbol_table.h>
18
18
19
- #include < ansi-c/c_qualifiers.h>
20
-
21
19
#include " goto_functions.h"
22
20
23
21
#define LOG (message, irep ) \
@@ -786,16 +784,10 @@ bool remove_const_function_pointerst::is_const_expression(
786
784
// / arrays are implicitly const in C.
787
785
bool remove_const_function_pointerst::is_const_type (const typet &type) const
788
786
{
789
- c_qualifierst qualifers (type);
790
- if (type.id ()==ID_array)
791
- {
792
- c_qualifierst array_type_qualifers (type.subtype ());
793
- return qualifers.is_constant || array_type_qualifers.is_constant ;
794
- }
795
- else
796
- {
797
- return qualifers.is_constant ;
798
- }
787
+ if (type.id () == ID_array && type.subtype ().get_bool (ID_C_constant))
788
+ return true ;
789
+
790
+ return type.get_bool (ID_C_constant);
799
791
}
800
792
801
793
// / To extract the value of the specific component within a struct
You can’t perform that action at this time.
0 commit comments