[lld] 596f490 - [ELF] De-template BitcodeFile::parse. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 21:46:32 PDT 2022


Author: Fangrui Song
Date: 2022-08-09T21:46:28-07:00
New Revision: 596f490ab940b6dfeddd72975fa8c5f322e94c9a

URL: https://github.com/llvm/llvm-project/commit/596f490ab940b6dfeddd72975fa8c5f322e94c9a
DIFF: https://github.com/llvm/llvm-project/commit/596f490ab940b6dfeddd72975fa8c5f322e94c9a.diff

LOG: [ELF] De-template BitcodeFile::parse. NFC

Added: 
    

Modified: 
    lld/ELF/InputFiles.cpp
    lld/ELF/InputFiles.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 81d910bfda27..c2522fd935a4 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -282,7 +282,7 @@ template <class ELFT> static void doParseFile(InputFile *file) {
   // LLVM bitcode file
   if (auto *f = dyn_cast<BitcodeFile>(file)) {
     ctx->bitcodeFiles.push_back(f);
-    f->parse<ELFT>();
+    f->parse();
     return;
   }
 
@@ -1662,7 +1662,7 @@ createBitcodeSymbol(Symbol *&sym, const std::vector<bool> &keptComdats,
   }
 }
 
-template <class ELFT> void BitcodeFile::parse() {
+void BitcodeFile::parse() {
   for (std::pair<StringRef, Comdat::SelectionKind> s : obj->getComdatTable()) {
     keptComdats.push_back(
         s.second == Comdat::NoDeduplicate ||
@@ -1802,11 +1802,6 @@ std::string elf::replaceThinLTOSuffix(StringRef path) {
   return std::string(path);
 }
 
-template void BitcodeFile::parse<ELF32LE>();
-template void BitcodeFile::parse<ELF32BE>();
-template void BitcodeFile::parse<ELF64LE>();
-template void BitcodeFile::parse<ELF64BE>();
-
 template class elf::ObjFile<ELF32LE>;
 template class elf::ObjFile<ELF32BE>;
 template class elf::ObjFile<ELF64LE>;

diff  --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h
index 0cb6a67ca00b..450c0295e13e 100644
--- a/lld/ELF/InputFiles.h
+++ b/lld/ELF/InputFiles.h
@@ -317,7 +317,7 @@ class BitcodeFile : public InputFile {
   BitcodeFile(MemoryBufferRef m, StringRef archiveName,
               uint64_t offsetInArchive, bool lazy);
   static bool classof(const InputFile *f) { return f->kind() == BitcodeKind; }
-  template <class ELFT> void parse();
+  void parse();
   void parseLazy();
   void postParse();
   std::unique_ptr<llvm::lto::InputFile> obj;


        


More information about the llvm-commits mailing list