[PATCH] D26042: Consolidate BumpPtrAllocators.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 10:57:42 PDT 2016


ruiu added inline comments.


================
Comment at: ELF/Driver.h:65
-private:
-  llvm::BumpPtrAllocator Alloc;
 };
----------------
rafael wrote:
> This one might make sense to remain. We can free it after option parsing, no?
No, we can't. Config may have a StringRef referring a command line argument.


================
Comment at: ELF/DriverUtils.cpp:81
   // Expand response files. '@<filename>' is replaced by the file's contents.
-  StringSaver Saver(Alloc);
   cl::ExpandResponseFiles(Saver, getQuotingStyle(Args), Vec);
----------------
rafael wrote:
> This too can be freed earlier.
Ditto. (And this is not freed until Driver is freed now, too, because Alloc has the same lifetime as Driver and Driver has the same lifetime as the entire linker.)


https://reviews.llvm.org/D26042





More information about the llvm-commits mailing list