MCPcopy Create free account
hub / github.com/csmith-project/csmith / add_effect

Method add_effect

src/Effect.cpp:181–214  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

179 *
180 */
181void
182Effect::add_effect(const Effect &e, bool include_lhs_effects)
183{
184 if (this == &e) {
185 return;
186 }
187
188 // Stuff that so badly wants to be rewritten using decent STL containers
189 // and algorithms... compute the union effect.
190
191 vector<const Variable *>::size_type len;
192 vector<const Variable *>::size_type i;
193
194 len = e.read_vars.size();
195 for (i = 0; i < len; ++i) {
196 // this->read_var(e.read_vars[i]);
197 if (!is_read(e.read_vars[i])) {
198 this->read_vars.push_back(e.read_vars[i]);
199 }
200 }
201 len = e.write_vars.size();
202 for (i = 0; i < len; ++i) {
203 // this->write_var(e.write_vars[i]);
204 if (!is_written(e.write_vars[i])) {
205 this->write_vars.push_back(e.write_vars[i]);
206 }
207 }
208
209 if (include_lhs_effects) {
210 add_variables_to_set(lhs_write_vars, e.get_lhs_write_vars());
211 }
212 pure &= e.pure;
213 side_effect_free &= e.side_effect_free;
214}
215
216/*
217 *

Callers 15

shortcut_analysisMethod · 0.45
analyze_with_edges_inMethod · 0.45
make_randomMethod · 0.45
visit_factsMethod · 0.45
make_randomMethod · 0.45
visit_indicesMethod · 0.45
append_return_stmtMethod · 0.45
append_nested_loopMethod · 0.45
build_invocationMethod · 0.45

Calls 2

add_variables_to_setFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected