[lld] Make helpers static. NFC.

llvm-svn: 332408
This commit is contained in:
Benjamin Kramer 2018-05-15 22:01:54 +00:00
parent 919882638e
commit 5455038d98
4 changed files with 7 additions and 5 deletions

View 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;

View 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);

View 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.

View 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"