[PATCH] D35868: Detemplate SymbolTable

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 10:13:49 PDT 2017


ruiu added a comment.

Generally looking good.



================
Comment at: ELF/Driver.cpp:951-952
 template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
-  SymbolTable<ELFT> Symtab;
-  elf::Symtab<ELFT>::X = &Symtab;
+  SymbolTable Symtab;
+  elf::Symtab = &Symtab;
   Target = getTarget();
----------------
Now you can move this to elf::link as it doesn't require ELFT.


================
Comment at: ELF/Driver.cpp:1039
         InputSections.push_back(S);
-  for (BinaryFile *F : Symtab.getBinaryFiles())
+  for (BinaryFile *F : elf::Files<ELFT>::BinaryFiles)
     for (InputSectionBase *S : F->getSections())
----------------
Maybe adding `Instances` or something to each class is better? I mean, if you do, you can do this without ELFT like this.

  for (BinaryFile *F : BinaryFile::Instances)

(This is just an idea, so I'm not really sure if this is a good one, though.)


https://reviews.llvm.org/D35868





More information about the llvm-commits mailing list