[lld-macho] Use namespace qualifiers (macho::) instead of `namespace lld { namespace...
authorFangrui Song <i@maskray.me>
Wed, 24 Jun 2020 19:22:13 +0000 (12:22 -0700)
committerFangrui Song <i@maskray.me>
Wed, 24 Jun 2020 19:34:06 +0000 (12:34 -0700)
See https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
Similar to D79982.

Reviewed By: #lld-macho, int3

Differential Revision: https://reviews.llvm.org/D82432

lld/MachO/ExportTrie.cpp
lld/MachO/SyntheticSections.cpp

index de8b42d..7cc81bc 100644 (file)
@@ -64,10 +64,7 @@ struct ExportInfo {
 
 } // namespace
 
-namespace lld {
-namespace macho {
-
-struct TrieNode {
+struct macho::TrieNode {
   std::vector<Edge> edges;
   Optional<ExportInfo> info;
   // Estimated offset from the start of the serialized trie to the current node.
@@ -277,13 +274,10 @@ void TrieParser::parse(const uint8_t *buf, const Twine &cumulativeString) {
   }
 }
 
-void parseTrie(const uint8_t *buf, size_t size,
-               const TrieEntryCallback &callback) {
+void macho::parseTrie(const uint8_t *buf, size_t size,
+                      const TrieEntryCallback &callback) {
   if (size == 0)
     return;
 
   TrieParser(buf, size, callback).parse();
 }
-
-} // namespace macho
-} // namespace lld
index 1747cda..21471ec 100644 (file)
@@ -25,9 +25,11 @@ using namespace llvm;
 using namespace llvm::MachO;
 using namespace llvm::support;
 using namespace llvm::support::endian;
+using namespace lld;
+using namespace lld::macho;
 
-namespace lld {
-namespace macho {
+InStruct macho::in;
+std::vector<SyntheticSection *> macho::syntheticSections;
 
 SyntheticSection::SyntheticSection(const char *segname, const char *name)
     : OutputSection(SyntheticKind, name), segname(segname) {
@@ -345,9 +347,3 @@ void StringTableSection::writeTo(uint8_t *buf) const {
     off += str.size() + 1; // account for null terminator
   }
 }
-
-InStruct in;
-std::vector<SyntheticSection *> syntheticSections;
-
-} // namespace macho
-} // namespace lld