[PATCH] D28150: Move the section name from GlobalObject to the LLVMContext

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 10:06:16 PST 2016


mehdi_amini added inline comments.


================
Comment at: lib/IR/Globals.cpp:180
+  // context.
+  S = getContext().pImpl->SectionStrings.insert(S).first->first();
+  getContext().pImpl->GlobalObjectSections[this] = S;
----------------
jlebar wrote:
> Don't we "leak" section strings now?  (That is, if I call setSection(x) a bunch of times on the same object, all of the unique values of x will persist in the context forever.)
Yes: this is the common practice with the LLVMContext (Metadata, Type, Constant, ...)


https://reviews.llvm.org/D28150





More information about the llvm-commits mailing list