[ELF] ICF: change a dyn_cast<InputSection> to cast

ICF is performed after EhInputSections and MergeInputSections were
eliminated from inputSections. Every element of inputSections is an
InputSection.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@371744 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/ELF/ICF.cpp b/ELF/ICF.cpp
index 8664811..c50bbc6 100644
--- a/ELF/ICF.cpp
+++ b/ELF/ICF.cpp
@@ -446,10 +446,11 @@
 // The main function of ICF.
 template <class ELFT> void ICF<ELFT>::run() {
   // Collect sections to merge.
-  for (InputSectionBase *sec : inputSections)
-    if (auto *s = dyn_cast<InputSection>(sec))
-      if (isEligible(s))
-        sections.push_back(s);
+  for (InputSectionBase *sec : inputSections) {
+    auto *s = cast<InputSection>(sec);
+    if (isEligible(s))
+      sections.push_back(s);
+  }
 
   // Initially, we use hash values to partition sections.
   parallelForEach(sections, [&](InputSection *s) {