MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / getUsers

Method getUsers

ir/function.cpp:378–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378Function::UsersTy Function::getUsers() const {
379 UsersTy users;
380 for (auto *bb : getBBs()) {
381 for (auto &i : bb->instrs()) {
382 for (auto op : i.operands()) {
383 add_users(users, const_cast<Instr*>(&i), bb, op);
384 }
385 }
386 }
387 for (auto &agg : aggregates) {
388 add_users(users, agg.get(), nullptr, agg.get());
389 }
390 for (auto &c : constants) {
391 if (auto agg = dynamic_cast<AggregateValue*>(c.get())) {
392 add_users(users, agg, nullptr, agg);
393 }
394 }
395 return users;
396}
397
398template <typename T>
399static bool removeUnused(T &data, const Function::UsersTy &users,

Callers 3

can_remove_initFunction · 0.80
preprocessMethod · 0.80
isGVUsedMethod · 0.80

Calls 4

add_usersFunction · 0.85
instrsMethod · 0.45
operandsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected