@@ -121,6 +121,13 @@ class exprt:public irept
121
121
operands ().push_back (expr);
122
122
}
123
123
124
+ // / Copy the given argument to the end of `exprt`'s operands.
125
+ // / \param expr: `exprt` to append to the operands
126
+ void copy_to_operands (exprt &&expr)
127
+ {
128
+ operands ().push_back (std::move (expr));
129
+ }
130
+
124
131
// / Copy the given arguments to the end of `exprt`'s operands.
125
132
// / \param e1: first `exprt` to append to the operands
126
133
// / \param e2: second `exprt` to append to the operands
@@ -134,6 +141,19 @@ class exprt:public irept
134
141
op.push_back (e2 );
135
142
}
136
143
144
+ // / Copy the given arguments to the end of `exprt`'s operands.
145
+ // / \param e1: first `exprt` to append to the operands
146
+ // / \param e2: second `exprt` to append to the operands
147
+ void copy_to_operands (exprt &&e1 , exprt &&e2 )
148
+ {
149
+ operandst &op = operands ();
150
+ #ifndef USE_LIST
151
+ op.reserve (op.size () + 2 );
152
+ #endif
153
+ op.push_back (std::move (e1 ));
154
+ op.push_back (std::move (e2 ));
155
+ }
156
+
137
157
// / Copy the given arguments to the end of `exprt`'s operands.
138
158
// / \param e1: first `exprt` to append to the operands
139
159
// / \param e2: second `exprt` to append to the operands
@@ -149,6 +169,21 @@ class exprt:public irept
149
169
op.push_back (e3 );
150
170
}
151
171
172
+ // / Copy the given arguments to the end of `exprt`'s operands.
173
+ // / \param e1: first `exprt` to append to the operands
174
+ // / \param e2: second `exprt` to append to the operands
175
+ // / \param e3: third `exprt` to append to the operands
176
+ void copy_to_operands (exprt &&e1 , exprt &&e2 , exprt &&e3 )
177
+ {
178
+ operandst &op = operands ();
179
+ #ifndef USE_LIST
180
+ op.reserve (op.size () + 3 );
181
+ #endif
182
+ op.push_back (std::move (e1 ));
183
+ op.push_back (std::move (e2 ));
184
+ op.push_back (std::move (e3 ));
185
+ }
186
+
152
187
void make_typecast (const typet &_type);
153
188
void make_not ();
154
189
0 commit comments