From: Benjamin Kramer Date: Tue, 15 May 2018 22:01:54 +0000 (+0000) Subject: [lld] Make helpers static. NFC. X-Git-Tag: llvmorg-7.0.0-rc1~5944 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5455038d98b7c48e21603ef86200847834c0a086;p=platform%2Fupstream%2Fllvm.git [lld] Make helpers static. NFC. llvm-svn: 332408 --- diff --git a/lld/ELF/Arch/X86_64.cpp b/lld/ELF/Arch/X86_64.cpp index 8848345..cc506a1 100644 --- a/lld/ELF/Arch/X86_64.cpp +++ b/lld/ELF/Arch/X86_64.cpp @@ -573,7 +573,7 @@ void RetpolineZNow::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, write32le(Buf + 8, -TargetInfo::getPltEntryOffset(Index) - 12); } -template TargetInfo *getTargetInfo() { +template static TargetInfo *getTargetInfo() { if (Config->ZRetpolineplt) { if (Config->ZNow) { static RetpolineZNow T; diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index f7b03ee..4e2746f 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -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 -void replaceOrFetchLazy(StringRef Name, InputFile &File, - llvm::function_ref Fetch, - ArgT &&... Arg) { +static void replaceOrFetchLazy(StringRef Name, InputFile &File, + llvm::function_ref Fetch, + ArgT &&... Arg) { Symbol *S; bool WasInserted; std::tie(S, WasInserted) = Symtab->insert(Name); diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp index 6f321da..7a836c5 100644 --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -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 Argv); }; +} // namespace // Set color diagnostics according to -color-diagnostics={auto,always,never} // or -no-color-diagnostics flags. diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 37f8b96..925c623 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -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"