[ELF] Internalize isBitcode. NFC
authorFangrui Song <i@maskray.me>
Fri, 22 Jul 2022 18:56:46 +0000 (11:56 -0700)
committerFangrui Song <i@maskray.me>
Fri, 22 Jul 2022 18:56:46 +0000 (11:56 -0700)
lld/ELF/Driver.cpp
lld/ELF/InputFiles.h

index d4621c1..dd17adc 100644 (file)
@@ -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;
index 02538f4..a24e664 100644 (file)
@@ -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