| 880 | } |
| 881 | |
| 882 | static pair<Value*, uint64_t> collect_gep_offsets(Value &v) { |
| 883 | Value *ptr = &v; |
| 884 | uint64_t offset = 0; |
| 885 | |
| 886 | while (true) { |
| 887 | if (auto gep = dynamic_cast<GEP*>(ptr)) { |
| 888 | uint64_t off = gep->getMaxGEPOffset(); |
| 889 | if (off != UINT64_MAX) { |
| 890 | ptr = &gep->getPtr(); |
| 891 | offset += off; |
| 892 | continue; |
| 893 | } |
| 894 | } |
| 895 | break; |
| 896 | } |
| 897 | |
| 898 | return { ptr, offset }; |
| 899 | } |
| 900 | |
| 901 | static unsigned returns_nonlocal(const Instr &inst, |
| 902 | set<pair<Value*, uint64_t>> &cache) { |
no test coverage detected