diff options
author | Fangrui Song <maskray@google.com> | 2019-08-25 14:41:18 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-08-25 14:41:18 +0000 |
commit | 76f005535addf2ac4817c4f3a1c50330c44a6b57 (patch) | |
tree | 0b6ffb077faacf419b82a2e544e8e8ae7360c19a | |
parent | 55e8c91dd5a6b1ad84318985b351fbcbf8de817a (diff) | |
download | bcm5719-llvm-76f005535addf2ac4817c4f3a1c50330c44a6b57.tar.gz bcm5719-llvm-76f005535addf2ac4817c4f3a1c50330c44a6b57.zip |
[ELF] Delete a redundant dyn_cast<InputSection>. NFC
llvm-svn: 369868
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 6b5a0274304..a489943d62c 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -386,9 +386,11 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) { // which are common because they are in the default bfd script. // We do not ignore SHT_REL[A] linker-synthesized sections here because // want to support scripts that do custom layout for them. - if (auto *isec = dyn_cast<InputSection>(sec)) - if (isec->getRelocatedSection()) - continue; + // + // It is safe to assume that Sec is an InputSection because mergeable or + // EH input sections have already been handled and eliminated. + if (cast<InputSection>(sec)->getRelocatedSection()) + continue; std::string filename = getFilename(sec->file); if (!cmd->filePat.match(filename) || @@ -396,9 +398,6 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) { !pat.sectionPat.match(sec->name)) continue; - // It is safe to assume that Sec is an InputSection - // because mergeable or EH input sections have already been - // handled and eliminated. ret.push_back(cast<InputSection>(sec)); sec->assigned = true; } |