@@ -109,9 +109,40 @@ class exprt:public irept
109
109
void move_to_operands (exprt &e1 , exprt &e2 );
110
110
void move_to_operands (exprt &e1 , exprt &e2 , exprt &e3 );
111
111
112
- void copy_to_operands (const exprt &expr);
113
- void copy_to_operands (const exprt &e1 , const exprt &e2 );
114
- void copy_to_operands (const exprt &e1 , const exprt &e2 , const exprt &e3 );
112
+ // / Copy the given argument to the end of `exprt`'s operands.
113
+ // / \param expr: `exprt` to append to the operands
114
+ void copy_to_operands (const exprt &expr)
115
+ {
116
+ operands ().push_back (expr);
117
+ }
118
+
119
+ // / Copy the given arguments to the end of `exprt`'s operands.
120
+ // / \param e1: first `exprt` to append to the operands
121
+ // / \param e2: second `exprt` to append to the operands
122
+ void copy_to_operands (const exprt &e1 , const exprt &e2 )
123
+ {
124
+ operandst &op = operands ();
125
+ #ifndef USE_LIST
126
+ op.reserve (op.size () + 2 );
127
+ #endif
128
+ op.push_back (e1 );
129
+ op.push_back (e2 );
130
+ }
131
+
132
+ // / Copy the given arguments to the end of `exprt`'s operands.
133
+ // / \param e1: first `exprt` to append to the operands
134
+ // / \param e2: second `exprt` to append to the operands
135
+ // / \param e3: third `exprt` to append to the operands
136
+ void copy_to_operands (const exprt &e1 , const exprt &e2 , const exprt &e3 )
137
+ {
138
+ operandst &op = operands ();
139
+ #ifndef USE_LIST
140
+ op.reserve (op.size () + 3 );
141
+ #endif
142
+ op.push_back (e1 );
143
+ op.push_back (e2 );
144
+ op.push_back (e3 );
145
+ }
115
146
116
147
void make_typecast (const typet &_type);
117
148
void make_not ();
0 commit comments