[lld/win] Use C++17 nested namespace syntax in most places
Like D131354, but for COFF. No behavior change. Differential Revision: https://reviews.llvm.org/D131405
This commit is contained in:
parent
e4b2c52420
commit
7c26641d9d
@ -13,8 +13,7 @@
|
||||
#include "lld/Common/Memory.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeHashing.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
COFFLinkerContext::COFFLinkerContext()
|
||||
: symtab(*this), rootTimer("Total Linking Time"),
|
||||
@ -36,5 +35,4 @@ COFFLinkerContext::COFFLinkerContext()
|
||||
tpiStreamLayoutTimer("TPI Stream Layout", totalPdbLinkTimer),
|
||||
diskCommitTimer("Commit to Disk", totalPdbLinkTimer) {}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -18,8 +18,7 @@
|
||||
#include "lld/Common/CommonLinkerContext.h"
|
||||
#include "lld/Common/Timer.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class COFFLinkerContext : public CommonLinkerContext {
|
||||
public:
|
||||
@ -80,7 +79,6 @@ public:
|
||||
Timer diskCommitTimer;
|
||||
};
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -11,14 +11,12 @@
|
||||
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
class SectionChunk;
|
||||
class COFFLinkerContext;
|
||||
|
||||
llvm::DenseMap<const SectionChunk *, int>
|
||||
computeCallGraphProfileOrder(const COFFLinkerContext &ctx);
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -27,8 +27,7 @@ using namespace llvm::support::endian;
|
||||
using namespace llvm::COFF;
|
||||
using llvm::support::ulittle32_t;
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
SectionChunk::SectionChunk(ObjFile *f, const coff_section *h)
|
||||
: Chunk(SectionKind), file(f), header(h), repl(this) {
|
||||
@ -996,5 +995,4 @@ void AbsolutePointerChunk::writeTo(uint8_t *buf) const {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -21,8 +21,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
using llvm::COFF::ImportDirectoryTableEntry;
|
||||
using llvm::object::COFFSymbolRef;
|
||||
@ -698,8 +697,7 @@ void applyArm64Addr(uint8_t *off, uint64_t s, uint64_t p, int shift);
|
||||
void applyArm64Imm(uint8_t *off, uint64_t imm, uint32_t rangeLimit);
|
||||
void applyArm64Branch26(uint8_t *off, int64_t v);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
namespace llvm {
|
||||
template <>
|
||||
|
@ -21,8 +21,7 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
using llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN;
|
||||
using llvm::COFF::WindowsSubsystem;
|
||||
@ -289,7 +288,6 @@ struct Configuration {
|
||||
|
||||
extern std::unique_ptr<Configuration> config;
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,7 @@ using namespace llvm::object;
|
||||
using namespace llvm::support::endian;
|
||||
using namespace llvm::COFF;
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
namespace {
|
||||
|
||||
// Import table
|
||||
@ -752,5 +751,4 @@ EdataContents::EdataContents() {
|
||||
chunks.insert(chunks.end(), forwards.begin(), forwards.end());
|
||||
}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -12,8 +12,7 @@
|
||||
#include "Chunks.h"
|
||||
#include "Symbols.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
// Windows-specific.
|
||||
// IdataContents creates all chunks for the DLL import table.
|
||||
@ -76,7 +75,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -953,15 +953,13 @@ public:
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
/// This type is just a wrapper around GHashTable with external linkage so it
|
||||
/// can be used from a header.
|
||||
struct GHashState {
|
||||
GHashTable table;
|
||||
};
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
GHashTable::~GHashTable() { delete[] table; }
|
||||
|
||||
|
@ -17,18 +17,15 @@
|
||||
#include "llvm/Support/Error.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace codeview {
|
||||
namespace llvm::codeview {
|
||||
struct GloballyHashedType;
|
||||
} // namespace codeview
|
||||
namespace pdb {
|
||||
}
|
||||
namespace llvm::pdb {
|
||||
class NativeSession;
|
||||
class TpiStream;
|
||||
}
|
||||
} // namespace llvm
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
using llvm::codeview::GloballyHashedType;
|
||||
using llvm::codeview::TypeIndex;
|
||||
@ -175,7 +172,6 @@ TpiSource *makePrecompSource(COFFLinkerContext &ctx, ObjFile *file);
|
||||
TpiSource *makeUsePrecompSource(COFFLinkerContext &ctx, ObjFile *file,
|
||||
llvm::codeview::PrecompRecord ts);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -58,8 +58,7 @@ using namespace llvm::object;
|
||||
using namespace llvm::COFF;
|
||||
using namespace llvm::sys;
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
std::unique_ptr<Configuration> config;
|
||||
std::unique_ptr<LinkerDriver> driver;
|
||||
@ -2418,5 +2417,4 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
|
||||
ctx.rootTimer.print();
|
||||
}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -28,8 +28,7 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
extern std::unique_ptr<class LinkerDriver> driver;
|
||||
|
||||
@ -234,7 +233,6 @@ enum {
|
||||
#undef OPTION
|
||||
};
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -34,8 +34,7 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class ICF {
|
||||
public:
|
||||
@ -322,5 +321,4 @@ void doICF(COFFLinkerContext &ctx, ICFLevel icfLevel) {
|
||||
ICF(ctx, icfLevel).run();
|
||||
}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -13,15 +13,13 @@
|
||||
#include "lld/Common/LLVM.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class Chunk;
|
||||
class COFFLinkerContext;
|
||||
|
||||
void doICF(COFFLinkerContext &ctx, ICFLevel);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -9,11 +9,9 @@
|
||||
#ifndef LLD_COFF_LLDMAPFILE_H
|
||||
#define LLD_COFF_LLDMAPFILE_H
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
class COFFLinkerContext;
|
||||
void writeLLDMapFile(const COFFLinkerContext &ctx);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -27,14 +27,11 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
namespace lto {
|
||||
namespace llvm::lto {
|
||||
class LTO;
|
||||
}
|
||||
}
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class BitcodeFile;
|
||||
class InputFile;
|
||||
@ -56,6 +53,5 @@ private:
|
||||
llvm::DenseSet<StringRef> thinIndices;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9,11 +9,9 @@
|
||||
#ifndef LLD_COFF_MAPFILE_H
|
||||
#define LLD_COFF_MAPFILE_H
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
class COFFLinkerContext;
|
||||
void writeMapFile(COFFLinkerContext &ctx);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -13,8 +13,7 @@
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include <vector>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
// Set live bit on for each reachable chunk. Unmarked (unreachable)
|
||||
// COMDAT chunks will be ignored by Writer, so they will be excluded
|
||||
@ -70,4 +69,3 @@ void markLive(COFFLinkerContext &ctx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,14 +11,12 @@
|
||||
|
||||
#include "lld/Common/LLVM.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class COFFLinkerContext;
|
||||
|
||||
void markLive(COFFLinkerContext &ctx);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif // LLD_COFF_MARKLIVE_H
|
||||
|
@ -17,8 +17,7 @@
|
||||
#include "llvm/Option/ArgList.h"
|
||||
#include <vector>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
class COFFLinkerContext;
|
||||
|
||||
// Logic for deciding what symbols to export, when exporting all
|
||||
@ -59,7 +58,6 @@ std::vector<WrappedSymbol> addWrappedSymbols(COFFLinkerContext &ctx,
|
||||
|
||||
void wrapSymbols(COFFLinkerContext &ctx, ArrayRef<WrappedSymbol> wrapped);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -13,11 +13,9 @@
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace codeview {
|
||||
namespace llvm::codeview {
|
||||
union DebugInfo;
|
||||
}
|
||||
}
|
||||
|
||||
namespace lld {
|
||||
class Timer;
|
||||
|
@ -26,8 +26,7 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
StringRef ltrim1(StringRef s, const char *chars) {
|
||||
if (!s.empty() && strchr(chars, s[0]))
|
||||
@ -891,5 +890,4 @@ void SymbolTable::compileBitcodeFiles() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
@ -20,8 +20,7 @@ namespace llvm {
|
||||
struct LTOCodeGenerator;
|
||||
}
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
class Chunk;
|
||||
class CommonChunk;
|
||||
@ -142,7 +141,6 @@ std::vector<std::string> getSymbolLocations(ObjFile *file, uint32_t symIndex);
|
||||
|
||||
StringRef ltrim1(StringRef s, const char *chars);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -17,8 +17,7 @@
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include <atomic>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
|
||||
using llvm::codeview::GloballyHashedType;
|
||||
using llvm::codeview::TypeIndex;
|
||||
@ -79,7 +78,6 @@ private:
|
||||
COFFLinkerContext &ctx;
|
||||
};
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
@ -16,8 +16,7 @@
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
namespace lld::coff {
|
||||
static const int pageSize = 4096;
|
||||
class COFFLinkerContext;
|
||||
|
||||
@ -80,7 +79,6 @@ private:
|
||||
uint32_t stringTableOff = 0;
|
||||
};
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
} // namespace lld::coff
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user