File tree 7 files changed +11
-14
lines changed
7 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -576,15 +576,13 @@ bool cpp_typecheckt::standard_conversion_pointer_to_member(
576
576
code_typet code1=to_code_type (expr.type ().subtype ());
577
577
assert (!code1.parameters ().empty ());
578
578
code_typet::parametert this1=code1.parameters ()[0 ];
579
- INVARIANT (
580
- this1.get_base_name () == ID_this, " first parameter should be `this'" );
579
+ INVARIANT (this1.get_this (), " first parameter should be `this'" );
581
580
code1.parameters ().erase (code1.parameters ().begin ());
582
581
583
582
code_typet code2=to_code_type (type.subtype ());
584
583
assert (!code2.parameters ().empty ());
585
584
code_typet::parametert this2=code2.parameters ()[0 ];
586
- INVARIANT (
587
- this2.get_base_name () == ID_this, " first parameter should be `this'" );
585
+ INVARIANT (this2.get_this (), " first parameter should be `this'" );
588
586
code2.parameters ().erase (code2.parameters ().begin ());
589
587
590
588
if (this2.type ().subtype ().get_bool (ID_C_constant) &&
Original file line number Diff line number Diff line change @@ -698,7 +698,7 @@ void cpp_typecheckt::typecheck_expr_address_of(exprt &expr)
698
698
code_typet &code_type=to_code_type (op.type ().subtype ());
699
699
700
700
code_typet::parameterst &args=code_type.parameters ();
701
- if (!args.empty () && args[ 0 ]. get_base_name () == ID_this )
701
+ if (!args.empty () && args. front (). get_this () )
702
702
{
703
703
// it's a pointer to member function
704
704
const struct_tag_typet symbol (code_type.get (ID_C_member_name));
@@ -2192,7 +2192,7 @@ void cpp_typecheckt::typecheck_side_effect_function_call(
2192
2192
to_code_type (expr.function ().type ()).parameters ();
2193
2193
2194
2194
if (
2195
- !parameters.empty () && parameters.front ().get_base_name () == ID_this &&
2195
+ !parameters.empty () && parameters.front ().get_this () &&
2196
2196
!expr.arguments ().empty ())
2197
2197
{
2198
2198
const code_typet::parametert ¶meter = parameters.front ();
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ bool cpp_typecheck_fargst::match(
97
97
98
98
// "this" is a special case -- we turn the pointer type
99
99
// into a reference type to do the type matching
100
- if (it == ops.begin () && parameter.get_base_name () == ID_this )
100
+ if (it == ops.begin () && parameter.get_this () )
101
101
{
102
102
type.set (ID_C_reference, true );
103
103
type.set (ID_C_this, true );
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ irep_idt cpp_typecheckt::function_identifier(const typet &type)
174
174
code_typet::parameterst::const_iterator it=
175
175
parameters.begin ();
176
176
177
- if (it != parameters.end () && it->get_base_name () == ID_this )
177
+ if (it != parameters.end () && it->get_this () )
178
178
{
179
179
const typet &pointer=it->type ();
180
180
const typet &symbol =pointer.subtype ();
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ void cpp_typecheckt::convert_initializer(symbolt &symbol)
94
94
exprt new_object (ID_new_object, parameter.type ());
95
95
new_object.set (ID_C_lvalue, true );
96
96
97
- if (parameter.get_base_name () == ID_this )
97
+ if (parameter.get_this () )
98
98
{
99
99
fargs.has_object = true ;
100
100
new_object.type () = parameter.type ().subtype ();
Original file line number Diff line number Diff line change @@ -2075,7 +2075,7 @@ void cpp_typecheck_resolvet::apply_template_args(
2075
2075
2076
2076
if (
2077
2077
!code_type.parameters ().empty () &&
2078
- code_type.parameters ()[ 0 ]. get_base_name () == ID_this )
2078
+ code_type.parameters (). front (). get_this () )
2079
2079
{
2080
2080
// do we have an object?
2081
2081
if (fargs.has_object )
@@ -2129,9 +2129,7 @@ bool cpp_typecheck_resolvet::disambiguate_functions(
2129
2129
const code_typet::parameterst ¶meters=type.parameters ();
2130
2130
const code_typet::parametert ¶meter=parameters.front ();
2131
2131
2132
- INVARIANT (
2133
- parameter.get_base_name () == ID_this,
2134
- " first parameter should be `this'" );
2132
+ INVARIANT (parameter.get_this (), " first parameter should be `this'" );
2135
2133
2136
2134
if (type.return_type ().id () == ID_constructor)
2137
2135
{
Original file line number Diff line number Diff line change @@ -106,11 +106,12 @@ void cpp_typecheckt::typecheck_type(typet &type)
106
106
code_typet::parameterst ¶meters =
107
107
to_code_type (type.subtype ()).parameters ();
108
108
109
- if (parameters.empty () || parameters.front ().get_base_name () != ID_this )
109
+ if (parameters.empty () || ! parameters.front ().get_this () )
110
110
{
111
111
// Add 'this' to the parameters
112
112
code_typet::parametert a0 (pointer_type (class_object));
113
113
a0.set_base_name (ID_this);
114
+ a0.set_this ();
114
115
parameters.insert (parameters.begin (), a0);
115
116
}
116
117
}
You can’t perform that action at this time.
0 commit comments