[lld] Make helpers static. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 15 May 2018 22:01:54 +0000 (22:01 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 15 May 2018 22:01:54 +0000 (22:01 +0000)
llvm-svn: 332408

lld/ELF/Arch/X86_64.cpp
lld/ELF/SymbolTable.cpp
lld/wasm/Driver.cpp
lld/wasm/InputChunks.cpp

index 8848345..cc506a1 100644 (file)
@@ -573,7 +573,7 @@ void RetpolineZNow<ELFT>::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr,
   write32le(Buf + 8, -TargetInfo::getPltEntryOffset(Index) - 12);
 }
 
-template <class ELFT> TargetInfo *getTargetInfo() {
+template <class ELFT> static TargetInfo *getTargetInfo() {
   if (Config->ZRetpolineplt) {
     if (Config->ZNow) {
       static RetpolineZNow<ELFT> T;
index f7b03ee..4e2746f 100644 (file)
@@ -598,9 +598,9 @@ Symbol *SymbolTable::find(StringRef Name) {
 // This is used to handle lazy symbols. May replace existent
 // symbol with lazy version or request to Fetch it.
 template <class ELFT, typename LazyT, typename... ArgT>
-void replaceOrFetchLazy(StringRef Name, InputFile &File,
-                        llvm::function_ref<InputFile *()> Fetch,
-                        ArgT &&... Arg) {
+static void replaceOrFetchLazy(StringRef Name, InputFile &File,
+                               llvm::function_ref<InputFile *()> Fetch,
+                               ArgT &&... Arg) {
   Symbol *S;
   bool WasInserted;
   std::tie(S, WasInserted) = Symtab->insert(Name);
index 6f321da..7a836c5 100644 (file)
@@ -98,11 +98,13 @@ static const opt::OptTable::Info OptInfo[] = {
 #undef OPTION
 };
 
+namespace {
 class WasmOptTable : public llvm::opt::OptTable {
 public:
   WasmOptTable() : OptTable(OptInfo) {}
   opt::InputArgList parse(ArrayRef<const char *> Argv);
 };
+} // namespace
 
 // Set color diagnostics according to -color-diagnostics={auto,always,never}
 // or -no-color-diagnostics flags.
index 37f8b96..925c623 100644 (file)
@@ -23,7 +23,7 @@ using namespace llvm::support::endian;
 using namespace lld;
 using namespace lld::wasm;
 
-StringRef ReloctTypeToString(uint8_t RelocType) {
+static StringRef ReloctTypeToString(uint8_t RelocType) {
   switch (RelocType) {
 #define WASM_RELOC(NAME, REL) case REL: return #NAME;
 #include "llvm/BinaryFormat/WasmRelocs.def"