aboutsummaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-07-22 11:56:46 -0700
committerFangrui Song <i@maskray.me>2022-07-22 11:56:46 -0700
commit50f5f37b07a1bced92cab730f994e7117cfac2a2 (patch)
tree82aa7de1c7d0a54ef91125478f4f6999f8991c57 /lld
parente8fd49f24b0dd8896b9789d7841bd962d0cb410c (diff)
downloadllvm-50f5f37b07a1bced92cab730f994e7117cfac2a2.zip
llvm-50f5f37b07a1bced92cab730f994e7117cfac2a2.tar.gz
llvm-50f5f37b07a1bced92cab730f994e7117cfac2a2.tar.bz2
[ELF] Internalize isBitcode. NFC
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/Driver.cpp4
-rw-r--r--lld/ELF/InputFiles.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index d4621c1..dd17adc 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -197,6 +197,10 @@ std::vector<std::pair<MemoryBufferRef, uint64_t>> static getArchiveMembers(
return v;
}
+static bool isBitcode(MemoryBufferRef mb) {
+ return identify_magic(mb.getBuffer()) == llvm::file_magic::bitcode;
+}
+
// Opens a file and create a file object. Path has to be resolved already.
void LinkerDriver::addFile(StringRef path, bool withLOption) {
using namespace sys::fs;
diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h
index 02538f4..a24e664 100644
--- a/lld/ELF/InputFiles.h
+++ b/lld/ELF/InputFiles.h
@@ -374,10 +374,6 @@ public:
ELFFileBase *createObjFile(MemoryBufferRef mb, StringRef archiveName = "",
bool lazy = false);
-inline bool isBitcode(MemoryBufferRef mb) {
- return identify_magic(mb.getBuffer()) == llvm::file_magic::bitcode;
-}
-
std::string replaceThinLTOSuffix(StringRef path);
} // namespace elf