Skip to content

Commit 273f375

Browse files
author
Daniel Kroening
authored
Merge pull request #3074 from diffblue/inline_copy_to_operands
Inline copy_to_operands
2 parents 46cd50b + d178327 commit 273f375

File tree

2 files changed

+34
-41
lines changed

2 files changed

+34
-41
lines changed

src/util/expr.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -65,44 +65,6 @@ void exprt::move_to_operands(exprt &e1, exprt &e2, exprt &e3)
6565
op.back().swap(e3);
6666
}
6767

68-
/// Copy the given argument to the end of `exprt`'s operands.
69-
/// \param expr: `exprt` to append to the operands
70-
void exprt::copy_to_operands(const exprt &expr)
71-
{
72-
operands().push_back(expr);
73-
}
74-
75-
/// Copy the given arguments to the end of `exprt`'s operands.
76-
/// \param e1: first `exprt` to append to the operands
77-
/// \param e2: second `exprt` to append to the operands
78-
void exprt::copy_to_operands(const exprt &e1, const exprt &e2)
79-
{
80-
operandst &op=operands();
81-
#ifndef USE_LIST
82-
op.reserve(op.size()+2);
83-
#endif
84-
op.push_back(e1);
85-
op.push_back(e2);
86-
}
87-
88-
/// Copy the given arguments to the end of `exprt`'s operands.
89-
/// \param e1: first `exprt` to append to the operands
90-
/// \param e2: second `exprt` to append to the operands
91-
/// \param e3: third `exprt` to append to the operands
92-
void exprt::copy_to_operands(
93-
const exprt &e1,
94-
const exprt &e2,
95-
const exprt &e3)
96-
{
97-
operandst &op=operands();
98-
#ifndef USE_LIST
99-
op.reserve(op.size()+3);
100-
#endif
101-
op.push_back(e1);
102-
op.push_back(e2);
103-
op.push_back(e3);
104-
}
105-
10668
/// Create a \ref typecast_exprt to the given type.
10769
/// \param _type: cast destination type
10870
/// \deprecated use constructors instead

src/util/expr.h

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,40 @@ class exprt:public irept
109109
void move_to_operands(exprt &e1, exprt &e2);
110110
void move_to_operands(exprt &e1, exprt &e2, exprt &e3);
111111

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+
}
115146

116147
void make_typecast(const typet &_type);
117148
void make_not();

0 commit comments

Comments
 (0)