@@ -126,45 +126,58 @@ linker_script_merget::linker_script_merget(
126
126
{replacement_predicatet (
127
127
" address of array's first member" ,
128
128
[](const exprt &expr) -> const symbol_exprt & {
129
- return to_symbol_expr (expr.op0 ().op0 ());
129
+ return to_symbol_expr (
130
+ to_index_expr (to_address_of_expr (expr).object ()).index ());
130
131
},
131
132
[](const exprt &expr) {
132
133
return expr.id () == ID_address_of &&
133
134
expr.type ().id () == ID_pointer &&
134
135
135
- expr.op0 ().id () == ID_index &&
136
- expr.op0 ().type ().id () == ID_unsignedbv &&
137
-
138
- expr.op0 ().op0 ().id () == ID_symbol &&
139
- expr.op0 ().op0 ().type ().id () == ID_array &&
140
-
141
- expr.op0 ().op1 ().id () == ID_constant &&
142
- expr.op0 ().op1 ().type ().id () == ID_signedbv;
136
+ to_address_of_expr (expr).object ().id () == ID_index &&
137
+ to_address_of_expr (expr).object ().type ().id () ==
138
+ ID_unsignedbv &&
139
+
140
+ to_index_expr (to_address_of_expr (expr).object ())
141
+ .array ()
142
+ .id () == ID_symbol &&
143
+ to_index_expr (to_address_of_expr (expr).object ())
144
+ .array ()
145
+ .type ()
146
+ .id () == ID_array &&
147
+
148
+ to_index_expr (to_address_of_expr (expr).object ())
149
+ .index ()
150
+ .id () == ID_constant &&
151
+ to_index_expr (to_address_of_expr (expr).object ())
152
+ .index ()
153
+ .type ()
154
+ .id () == ID_signedbv;
143
155
}),
144
156
replacement_predicatet (
145
157
" address of array" ,
146
158
[](const exprt &expr) -> const symbol_exprt & {
147
- return to_symbol_expr (expr. op0 ());
159
+ return to_symbol_expr (to_address_of_expr ( expr). object ());
148
160
},
149
161
[](const exprt &expr) {
150
162
return expr.id () == ID_address_of &&
151
163
expr.type ().id () == ID_pointer &&
152
164
153
- expr. op0 ().id () == ID_symbol &&
154
- expr. op0 ().type ().id () == ID_array;
165
+ to_address_of_expr ( expr). object ().id () == ID_symbol &&
166
+ to_address_of_expr ( expr). object ().type ().id () == ID_array;
155
167
}),
156
168
replacement_predicatet (
157
169
" address of struct" ,
158
170
[](const exprt &expr) -> const symbol_exprt & {
159
- return to_symbol_expr (expr. op0 ());
171
+ return to_symbol_expr (to_address_of_expr ( expr). object ());
160
172
},
161
173
[](const exprt &expr) {
162
174
return expr.id () == ID_address_of &&
163
175
expr.type ().id () == ID_pointer &&
164
176
165
- expr.op0 ().id () == ID_symbol &&
166
- (expr.op0 ().type ().id () == ID_struct ||
167
- expr.op0 ().type ().id () == ID_struct_tag);
177
+ to_address_of_expr (expr).object ().id () == ID_symbol &&
178
+ (to_address_of_expr (expr).object ().type ().id () == ID_struct ||
179
+ to_address_of_expr (expr).object ().type ().id () ==
180
+ ID_struct_tag);
168
181
}),
169
182
replacement_predicatet (
170
183
" array variable" ,
0 commit comments