diff options
| author | George Rimar <grimar@accesssoftek.com> | 2018-07-11 15:18:23 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2018-07-11 15:18:23 +0000 |
| commit | 1aa8f39dc083e4f8499ab82e1bab271a16f9b9d8 (patch) | |
| tree | 4557b62a720c680219c94bd80d1c96d1f654c61d | |
| parent | cb17fdbe3c30e167b4a2f9c3342700967b7cf9c4 (diff) | |
| download | bcm5719-llvm-1aa8f39dc083e4f8499ab82e1bab271a16f9b9d8.tar.gz bcm5719-llvm-1aa8f39dc083e4f8499ab82e1bab271a16f9b9d8.zip | |
[ELF] - Simplify. NFCI.
It does not look possible to end up with empty Sections
at this place. And this knowledge allows simplifying the code.
llvm-svn: 336814
| -rw-r--r-- | lld/ELF/Writer.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 495c37ffab5..2f58be57b23 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1425,13 +1425,12 @@ template <class ELFT> void Writer<ELFT>::resolveShfLinkOrder() { if (!Config->Relocatable && Config->EMachine == EM_ARM && Sec->Type == SHT_ARM_EXIDX) { - if (!Sections.empty() && isa<ARMExidxSentinelSection>(Sections.back())) { + if (auto *Sentinel = dyn_cast<ARMExidxSentinelSection>(Sections.back())) { assert(Sections.size() >= 2 && "We should create a sentinel section only if there are " "alive regular exidx sections."); // The last executable section is required to fill the sentinel. // Remember it here so that we don't have to find it again. - auto *Sentinel = cast<ARMExidxSentinelSection>(Sections.back()); Sentinel->Highest = Sections[Sections.size() - 2]->getLinkOrderDep(); } |

