[PATCH] Move ownership of GCStrategy objects to LLVMContext
Ramkumar Ramachandra
artagnon at gmail.com
Mon Jan 5 12:07:39 PST 2015
================
Comment at: lib/CodeGen/GCMetadata.cpp:80
@@ -94,1 +79,3 @@
+ // Context.
+ StrategyList.push_back(S);
Functions.push_back(make_unique<GCFunctionInfo>(F, *S));
----------------
artagnon wrote:
> reames wrote:
> > artagnon wrote:
> > > There is no user of this StrategyList. The only iterator I can see is in getGCStrategy(), and that uses GCStrategyList. What is this for?
> > Again, what? There is no GCStrategyList member variable.
> >
> >
> I've probably been staring at this for too long, but StrategyList doesn't really seem to be looked up or iterated over anywhere. Can you show me a counterexample? Dump from a git-grep:
> ```
> artagnon|gc-relocate>:~/src/llvm$ g g StrategyList
> include/llvm/CodeGen/GCMetadata.h=43=namespace llvm {
> include/llvm/CodeGen/GCMetadata.h:171: list_type StrategyList;
> include/llvm/CodeGen/GCMetadata.h:207: iterator begin() const { return StrategyList.begin(); }
> include/llvm/CodeGen/GCMetadata.h:208: iterator end() const { return StrategyList.end(); }
> lib/CodeGen/GCMetadata.cpp=64=GCStrategy *GCModuleInfo::getOrCreateStrategy(const Module *M,
> lib/CodeGen/GCMetadata.cpp:76: StrategyList.push_back(std::move(S));
> lib/CodeGen/GCMetadata.cpp:77: return StrategyList.back().get();
> lib/CodeGen/GCMetadata.cpp=100=void GCModuleInfo::clear() {
> lib/CodeGen/GCMetadata.cpp:104: StrategyList.clear();
> ```
Uh, never mind. GCModuleInfo::iterator is used in LowerIntrinsics::doInitialization() and AsmPrinter::doFinalization().
Sorry about that.
*goes to get more coffee*
http://reviews.llvm.org/D6811
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list