[PATCH] D15327: [ELF] - Implemented --print-gc-sections command line argument.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 10:07:55 PST 2015
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.
LGTM with nits.
================
Comment at: ELF/Writer.cpp:538
@@ +537,3 @@
+ const std::unique_ptr<ObjectFile<ELFT>> &File) {
+ if (Config->PrintGcSections && IS && !IS->isLive())
+ llvm::errs() << Twine("removing unused section from '") +
----------------
Let's invert this condition to return early.
if (!Config->PrintGcSections || !IS || Is->isLive())
return;
================
Comment at: ELF/Writer.cpp:539-541
@@ +538,5 @@
+ if (Config->PrintGcSections && IS && !IS->isLive())
+ llvm::errs() << Twine("removing unused section from '") +
+ IS->getSectionName() + "' in file '" + File->getName() +
+ "'"
+ << "\n";
----------------
llvm::errs() << "removing unused section from '" << IS->getSectionName()
<< "' in file '" << File->getName() << "'\n";
http://reviews.llvm.org/D15327
More information about the llvm-commits
mailing list