[PATCH] D40160: All .xdata sections are eligble for ICF

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 17:23:46 PST 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/COFF/ICF.cpp:83
   bool Writable = C->getPermissions() & llvm::COFF::IMAGE_SCN_MEM_WRITE;
-  return C->isCOMDAT() && C->isLive() && Global && Executable && !Writable;
+  return C->isCOMDAT() && C->isLive() &&
+         ((Global && Executable && !Writable) ||
----------------
I'd add `bool Xdata` for consistency.


https://reviews.llvm.org/D40160





More information about the llvm-commits mailing list