[lld] [lld][ELF] Simplify handleLibcall. NFC (PR #78659)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 18:16:28 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Sam Clegg (sbc100)
<details>
<summary>Changes</summary>
I noticed this while working on #<!-- -->78658
---
Full diff: https://github.com/llvm/llvm-project/pull/78659.diff
1 Files Affected:
- (modified) lld/ELF/Driver.cpp (+1-7)
``````````diff
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 5ccc65600dcb91..07f4263c90e62b 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -2081,13 +2081,7 @@ static void handleUndefinedGlob(StringRef arg) {
static void handleLibcall(StringRef name) {
Symbol *sym = symtab.find(name);
- if (!sym || !sym->isLazy())
- return;
-
- MemoryBufferRef mb;
- mb = cast<LazyObject>(sym)->file->mb;
-
- if (isBitcode(mb))
+ if (sym && sym->isLazy() && isa<BitcodeFile>(sym->file))
sym->extract();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/78659
More information about the llvm-commits
mailing list