[lld] f1ba48d - [ELF] Simplify Symbol::extract. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 26 14:11:00 PST 2021
Author: Fangrui Song
Date: 2021-11-26T14:10:55-08:00
New Revision: f1ba48d50800e3d39027af9e5dff56f35ac21ce4
URL: https://github.com/llvm/llvm-project/commit/f1ba48d50800e3d39027af9e5dff56f35ac21ce4
DIFF: https://github.com/llvm/llvm-project/commit/f1ba48d50800e3d39027af9e5dff56f35ac21ce4.diff
LOG: [ELF] Simplify Symbol::extract. NFC
Added:
Modified:
lld/ELF/Symbols.cpp
Removed:
################################################################################
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index da3ade1b9dad2..8c410b4d5bfbb 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -257,17 +257,10 @@ void Symbol::parseSymbolVersion() {
}
void Symbol::extract() const {
- if (auto *sym = dyn_cast<LazyArchive>(this)) {
+ if (auto *sym = dyn_cast<LazyArchive>(this))
cast<ArchiveFile>(sym->file)->extract(sym->sym);
- return;
- }
-
- if (auto *sym = dyn_cast<LazyObject>(this)) {
- dyn_cast<LazyObjFile>(sym->file)->extract();
- return;
- }
-
- llvm_unreachable("Symbol::extract() is called on a non-lazy symbol");
+ else
+ cast<LazyObjFile>(this->file)->extract();
}
MemoryBufferRef LazyArchive::getMemberBuffer() {
More information about the llvm-commits
mailing list