| 206 | } |
| 207 | |
| 208 | std::vector<Instruction*> DefUseManager::GetAnnotations(uint32_t id) const { |
| 209 | std::vector<Instruction*> annos; |
| 210 | const Instruction* def = GetDef(id); |
| 211 | if (!def) return annos; |
| 212 | |
| 213 | ForEachUser(def, [&annos](Instruction* user) { |
| 214 | if (IsAnnotationInst(user->opcode())) { |
| 215 | annos.push_back(user); |
| 216 | } |
| 217 | }); |
| 218 | return annos; |
| 219 | } |
| 220 | |
| 221 | void DefUseManager::AnalyzeDefUse(Module* module) { |
| 222 | if (!module) return; |