From bb3198949f0d2ab261e2ecaaf1f64ee3be37893b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 20 Dec 2017 20:46:08 +0000 Subject: [PATCH] Use dyn_cast instead of dyn_cast_or_null. There should be no null sections in InputSections. llvm-svn: 321219 --- lld/ELF/MarkLive.cpp | 2 +- lld/ELF/Target.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 3e56ae09ed51..88f558c7a3c6 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -246,7 +246,7 @@ template static void doGcSections() { // that point to .eh_frames. Otherwise, the garbage collector would drop // all of them. We also want to preserve personality routines and LSDA // referenced by .eh_frame sections, so we scan them for that here. - if (auto *EH = dyn_cast_or_null(Sec)) { + if (auto *EH = dyn_cast(Sec)) { EH->Live = true; scanEhFrameSection(*EH, Enqueue); } diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index ddd408906d14..b528fd583c1a 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -89,7 +89,7 @@ TargetInfo *elf::getTarget() { template static std::string getErrorLoc(const uint8_t *Loc) { for (InputSectionBase *D : InputSections) { - auto *IS = dyn_cast_or_null(D); + auto *IS = dyn_cast(D); if (!IS || !IS->getParent()) continue;