summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-07-05 14:09:47 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-07-05 14:09:47 +0000
commitccf0db9974d80a5d7eca466ba8a1e7d7ae868890 (patch)
treecc3255837099caf2d4e3c0a6040f5706086f836a
parentd87b1eed8e929dc997b9b1c826299f35e33c6060 (diff)
downloadbcm5719-llvm-ccf0db9974d80a5d7eca466ba8a1e7d7ae868890.tar.gz
bcm5719-llvm-ccf0db9974d80a5d7eca466ba8a1e7d7ae868890.zip
[ELF] - Convert excessive dyn_cast -> cast. NFC.
Currently, there are only OutputSection and SymbolAssignment commands possible at the first level under SECTIONS tag. Hence, dyn_cast was excessive. llvm-svn: 336354
-rw-r--r--lld/ELF/LinkerScript.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 07697ec37f5..817c6c69ace 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -248,13 +248,12 @@ void LinkerScript::declareSymbols() {
declareSymbol(Cmd);
continue;
}
- auto *Sec = dyn_cast<OutputSection>(Base);
- if (!Sec)
- continue;
+
// If the output section directive has constraints,
// we can't say for sure if it is going to be included or not.
// Skip such sections for now. Improve the checks if we ever
// need symbols from that sections to be declared early.
+ auto *Sec = cast<OutputSection>(Base);
if (Sec->Constraint != ConstraintKind::NoConstraint)
continue;
for (BaseCommand *Base2 : Sec->SectionCommands)
OpenPOWER on IntegriCloud