[PATCH] D31932: [LLD][ELF] Mark ARM Exceptions that refer to folded code as not live

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 13:56:12 PDT 2017


ruiu added a comment.

LGTM. I thought for a while to try to find a better way, but looks like this is the simplest way of doing it.



================
Comment at: ELF/ICF.cpp:382-391
+  if (Config->EMachine == EM_ARM)
+    for (InputSectionBase *Sec : InputSections) {
+      auto *S = dyn_cast<InputSection>(Sec);
+      if (!S || !(S->Flags & SHF_LINK_ORDER))
+        continue;
+      InputSectionBase *CodeSec = S->getLinkOrderDep();
+      if (CodeSec->Live == false)
----------------
Looks like this can be

  if (Config->EMachine == EM_ARM)
    for (InputSectionBase *Sec : InputSections)
      if (auto *S = dyn_cast<InputSection>(Sec))
        if (S->Flags & SHF_LINK_ORDER)
          S->getLinkOrderDep()->Live = S->Live;


https://reviews.llvm.org/D31932





More information about the llvm-commits mailing list