diff options
| -rw-r--r-- | lld/COFF/Librarian.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/MarkLive.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/SymbolListFile.cpp | 4 | ||||
| -rw-r--r-- | lld/lib/Core/Error.cpp | 2 |
4 files changed, 9 insertions, 1 deletions
diff --git a/lld/COFF/Librarian.cpp b/lld/COFF/Librarian.cpp index 25fb4a87b3e..e0f874cf897 100644 --- a/lld/COFF/Librarian.cpp +++ b/lld/COFF/Librarian.cpp @@ -54,7 +54,7 @@ static uint16_t getImgRelRelocation() { } } -template <class T> void append(std::vector<uint8_t> &B, const T &Data) { +template <class T> static void append(std::vector<uint8_t> &B, const T &Data) { size_t S = B.size(); B.resize(S + sizeof(T)); memcpy(&B[S], &Data, sizeof(T)); diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 23e4fbff3a0..4277b792256 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -41,6 +41,7 @@ using namespace llvm::support::endian; using namespace lld; using namespace lld::elf; +namespace { // A resolved relocation. The Sec and Offset fields are set if the relocation // was resolved to an offset within a section. template <class ELFT> @@ -48,6 +49,7 @@ struct ResolvedReloc { InputSectionBase<ELFT> *Sec; typename ELFT::uint Offset; }; +} // end anonymous namespace template <class ELFT> static typename ELFT::uint getAddend(InputSectionBase<ELFT> &Sec, diff --git a/lld/ELF/SymbolListFile.cpp b/lld/ELF/SymbolListFile.cpp index 9e088025c1b..c54f509fc7c 100644 --- a/lld/ELF/SymbolListFile.cpp +++ b/lld/ELF/SymbolListFile.cpp @@ -31,11 +31,13 @@ using namespace lld::elf; // Multiple groups can be defined in the same file, and they are merged // into a single group. +namespace { class DynamicListParser final : public ScriptParserBase { public: DynamicListParser(StringRef S) : ScriptParserBase(S) {} void run(); }; +} // end anonymous namespace void DynamicListParser::run() { while (!atEOF()) { @@ -62,6 +64,7 @@ void elf::parseDynamicList(MemoryBufferRef MB) { // No wildcards are supported, other than for the local entry. Symbol versioning // is also not supported. +namespace { class VersionScriptParser final : public ScriptParserBase { public: VersionScriptParser(StringRef S) : ScriptParserBase(S) {} @@ -74,6 +77,7 @@ private: void parseGlobal(StringRef VerStr); void parseLocal(); }; +} // end anonymous namespace size_t elf::defineSymbolVersion(StringRef VerStr) { // Identifiers start at 2 because 0 and 1 are reserved diff --git a/lld/lib/Core/Error.cpp b/lld/lib/Core/Error.cpp index 4df1ce120bd..cfb7e7abd03 100644 --- a/lld/lib/Core/Error.cpp +++ b/lld/lib/Core/Error.cpp @@ -16,6 +16,7 @@ using namespace lld; +namespace { class _YamlReaderErrorCategory : public std::error_category { public: const char* name() const LLVM_NOEXCEPT override { @@ -33,6 +34,7 @@ public: "message defined."); } }; +} // end anonymous namespace const std::error_category &lld::YamlReaderCategory() { static _YamlReaderErrorCategory o; |

