================ @@ -889,10 +919,50 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Value &V) { return OS; } +inline Use::~Use() { + if (Val) + Val->removeUse(*this); +} + +void Use::addToList(unsigned &Count) { + assert(isa<ConstantData>(Val) && "Only ConstantData is ref-counted"); + ++Count; + + // We don't have a uselist - clear the remnant if we are replacing a + // non-constant value. + Prev = nullptr; + Next = nullptr; ---------------- nikic wrote:
Can you explain in more detail when this is necessary? It seems odd to me that addToList() should be responsible for nulling out these pointers. https://github.com/llvm/llvm-project/pull/134692 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits