File tree 2 files changed +48
-0
lines changed
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,22 @@ class exprt:public irept
97
97
const operandst &operands () const
98
98
{ return (const operandst &)get_sub (); }
99
99
100
+ // / Add the source location from \p location, if it is non-nil.
101
+ exprt &with_source_location (source_locationt location) &
102
+ {
103
+ if (location.is_not_nil ())
104
+ add_source_location () = std::move (location);
105
+ return *this ;
106
+ }
107
+
108
+ // / Add the source location from \p location, if it is non-nil.
109
+ exprt &&with_source_location(source_locationt location) &&
110
+ {
111
+ if (location.is_not_nil ())
112
+ add_source_location () = std::move (location);
113
+ return std::move (*this );
114
+ }
115
+
100
116
// / Add the source location from \p other, if it has any.
101
117
exprt &with_source_location (const exprt &other) &
102
118
{
Original file line number Diff line number Diff line change @@ -161,6 +161,38 @@ class symbol_exprt : public nullary_exprt
161
161
{
162
162
return get (ID_identifier);
163
163
}
164
+
165
+ // / Add the source location from \p location, if it is non-nil.
166
+ symbol_exprt &with_source_location (source_locationt location) &
167
+ {
168
+ if (location.is_not_nil ())
169
+ add_source_location () = std::move (location);
170
+ return *this ;
171
+ }
172
+
173
+ // / Add the source location from \p location, if it is non-nil.
174
+ symbol_exprt &&with_source_location(source_locationt location) &&
175
+ {
176
+ if (location.is_not_nil ())
177
+ add_source_location () = std::move (location);
178
+ return std::move (*this );
179
+ }
180
+
181
+ // / Add the source location from \p other, if it has any.
182
+ symbol_exprt &with_source_location (const exprt &other) &
183
+ {
184
+ if (other.source_location ().is_not_nil ())
185
+ add_source_location () = other.source_location ();
186
+ return *this ;
187
+ }
188
+
189
+ // / Add the source location from \p other, if it has any.
190
+ symbol_exprt &&with_source_location(const exprt &other) &&
191
+ {
192
+ if (other.source_location ().is_not_nil ())
193
+ add_source_location () = other.source_location ();
194
+ return std::move (*this );
195
+ }
164
196
};
165
197
166
198
// NOLINTNEXTLINE(readability/namespace)
You can’t perform that action at this time.
0 commit comments