[PATCH] D44516: [ELF] - Treat --just-symbols file as an input.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 21:33:41 PDT 2018


ruiu added a comment.

I think I implemented the exact same thing in my patch already which I haven't submitted, and I think mine is better than this patch. I don't like to mix adding a feature for JustSymbols to ObjFile class. Because JustSymbols is so minor, I don't want to mix code for that feature with the regular code path.



================
Comment at: ELF/Driver.cpp:176
 // Opens a file and create a file object. Path has to be resolved already.
-void LinkerDriver::addFile(StringRef Path, bool WithLOption) {
+void LinkerDriver::addFile(StringRef Path, bool WithLOption, bool JustSymbols) {
   using namespace sys::fs;
----------------
You don't need to call this function to add a new file to Files. Let's keep it simple. Just call createObjectFile and directly add its return value to Files. Basically, you should avoid adding this kind of ad-hoc new parameter to an existing function.


https://reviews.llvm.org/D44516





More information about the llvm-commits mailing list