Use dyn_cast instead of dyn_cast_or_null.

There should be no null sections in InputSections.

llvm-svn: 321219
This commit is contained in:
Rafael Espindola 2017-12-20 20:46:08 +00:00
parent fb0fcacb9d
commit bb3198949f
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ template <class ELFT> 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<EhInputSection>(Sec)) {
if (auto *EH = dyn_cast<EhInputSection>(Sec)) {
EH->Live = true;
scanEhFrameSection<ELFT>(*EH, Enqueue);
}

View File

@ -89,7 +89,7 @@ TargetInfo *elf::getTarget() {
template <class ELFT> static std::string getErrorLoc(const uint8_t *Loc) {
for (InputSectionBase *D : InputSections) {
auto *IS = dyn_cast_or_null<InputSection>(D);
auto *IS = dyn_cast<InputSection>(D);
if (!IS || !IS->getParent())
continue;