summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-07-17 11:35:28 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-07-17 11:35:28 +0000
commit904ed692a1ad42858ddec1a8e382bc94b8f8e60e (patch)
treeca2c8272fc192fcf8a51bda19ff559582f92cd86
parenta41b24f32dd04e30d4b8877eba69e9220225e403 (diff)
downloadbcm5719-llvm-904ed692a1ad42858ddec1a8e382bc94b8f8e60e.tar.gz
bcm5719-llvm-904ed692a1ad42858ddec1a8e382bc94b8f8e60e.zip
[ELF] - Simplify Symbol::getSize(). NFC.
There are following symbols currently available: DefinedKind, SharedKind, UndefinedKind, LazyArchiveKind, LazyObjectKind. Our code calls getSize() only for first two and there seems to be no reason to return 0 for the rest. llvm-svn: 337265
-rw-r--r--lld/ELF/Symbols.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index f2f9ae093f3..4243cb1e80e 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -144,9 +144,7 @@ uint64_t Symbol::getPltOffset() const {
uint64_t Symbol::getSize() const {
if (const auto *DR = dyn_cast<Defined>(this))
return DR->Size;
- if (const auto *S = dyn_cast<SharedSymbol>(this))
- return S->Size;
- return 0;
+ return cast<SharedSymbol>(this)->Size;
}
OutputSection *Symbol::getOutputSection() const {
OpenPOWER on IntegriCloud