Commit 18db086d authored by Fangrui Song's avatar Fangrui Song
Browse files

[lld-macho] Use namespace qualifiers (macho::) instead of `namespace lld { namespace macho {`

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
parent b4fdddf9
...@@ -64,10 +64,7 @@ struct ExportInfo { ...@@ -64,10 +64,7 @@ struct ExportInfo {
} // namespace } // namespace
namespace lld { struct macho::TrieNode {
namespace macho {
struct TrieNode {
std::vector<Edge> edges; std::vector<Edge> edges;
Optional<ExportInfo> info; Optional<ExportInfo> info;
// Estimated offset from the start of the serialized trie to the current node. // 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) { ...@@ -277,13 +274,10 @@ void TrieParser::parse(const uint8_t *buf, const Twine &cumulativeString) {
} }
} }
void parseTrie(const uint8_t *buf, size_t size, void macho::parseTrie(const uint8_t *buf, size_t size,
const TrieEntryCallback &callback) { const TrieEntryCallback &callback) {
if (size == 0) if (size == 0)
return; return;
TrieParser(buf, size, callback).parse(); TrieParser(buf, size, callback).parse();
} }
} // namespace macho
} // namespace lld
...@@ -25,9 +25,11 @@ using namespace llvm; ...@@ -25,9 +25,11 @@ using namespace llvm;
using namespace llvm::MachO; using namespace llvm::MachO;
using namespace llvm::support; using namespace llvm::support;
using namespace llvm::support::endian; using namespace llvm::support::endian;
using namespace lld;
using namespace lld::macho;
namespace lld { InStruct macho::in;
namespace macho { std::vector<SyntheticSection *> macho::syntheticSections;
SyntheticSection::SyntheticSection(const char *segname, const char *name) SyntheticSection::SyntheticSection(const char *segname, const char *name)
: OutputSection(SyntheticKind, name), segname(segname) { : OutputSection(SyntheticKind, name), segname(segname) {
...@@ -345,9 +347,3 @@ void StringTableSection::writeTo(uint8_t *buf) const { ...@@ -345,9 +347,3 @@ void StringTableSection::writeTo(uint8_t *buf) const {
off += str.size() + 1; // account for null terminator off += str.size() + 1; // account for null terminator
} }
} }
InStruct in;
std::vector<SyntheticSection *> syntheticSections;
} // namespace macho
} // namespace lld
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment