================ @@ -114,24 +115,221 @@ static inline void clearModule(Module &M) { // TODO: simplify. eraseFromModule(*M.ifuncs().begin()); } +static inline SmallVector<std::reference_wrapper<Use>> +collectIndirectableUses(GlobalVariable *G) { + // We are interested only in use chains that end in an Instruction. + SmallVector<std::reference_wrapper<Use>> Uses; + + SmallVector<std::reference_wrapper<Use>> Tmp(G->use_begin(), G->use_end()); + while (!Tmp.empty()) { + Use &U = Tmp.back(); + Tmp.pop_back(); ---------------- jmmartinez wrote:
```suggestion Use &U = Tmp.pop_back_val(); ``` https://github.com/llvm/llvm-project/pull/146813 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits