[llvm] [BOLT] Refactor tracking internals of BinaryFunction. NFCI (PR #167074)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 19:53:35 PST 2025
================
@@ -1520,6 +1520,17 @@ void BinaryContext::foldFunction(BinaryFunction &ChildBF,
}
ChildBF.getSymbols().clear();
----------------
maksfb wrote:
Thanks for the review.
The `clear()` call will remove symbol references from the list, but the symbols themselves will stay intact. All `MCSymbol`s are allocated in the `MCContext` and are managed by an instance of that class. I.e. even if `Rel->Symbol` was in the `getSymbols()` list (it shouldn't), it would still be valid to reference it.
https://github.com/llvm/llvm-project/pull/167074
More information about the llvm-commits
mailing list