diff --git a/lld/wasm/Config.h b/lld/wasm/Config.h --- a/lld/wasm/Config.h +++ b/lld/wasm/Config.h @@ -20,8 +20,7 @@ enum Level : int; } // namespace llvm::CodeGenOpt -namespace lld { -namespace wasm { +namespace lld::wasm { class InputFile; class Symbol; @@ -125,7 +124,6 @@ // The only instance of Configuration struct. extern Configuration *config; -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -42,8 +42,7 @@ using namespace llvm::sys; using namespace llvm::wasm; -namespace lld { -namespace wasm { +namespace lld::wasm { Configuration *config; namespace { @@ -1218,5 +1217,4 @@ writeResult(); } -} // namespace wasm -} // namespace lld +} // namespace wasm::lld diff --git a/lld/wasm/LTO.h b/lld/wasm/LTO.h --- a/lld/wasm/LTO.h +++ b/lld/wasm/LTO.h @@ -32,8 +32,7 @@ } } // namespace llvm -namespace lld { -namespace wasm { +namespace lld::wasm { class BitcodeFile; class InputFile; @@ -51,7 +50,6 @@ std::vector> buf; std::vector> files; }; -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/LTO.cpp b/lld/wasm/LTO.cpp --- a/lld/wasm/LTO.cpp +++ b/lld/wasm/LTO.cpp @@ -37,8 +37,7 @@ using namespace llvm; -namespace lld { -namespace wasm { +namespace lld::wasm { static std::unique_ptr createLTO() { lto::Config c; c.Options = initTargetOptionsFromCodeGenFlags(); @@ -165,5 +164,4 @@ return ret; } -} // namespace wasm -} // namespace lld +} // namespace lld::wasm diff --git a/lld/wasm/MapFile.h b/lld/wasm/MapFile.h --- a/lld/wasm/MapFile.h +++ b/lld/wasm/MapFile.h @@ -11,11 +11,9 @@ #include "llvm/ADT/ArrayRef.h" -namespace lld { -namespace wasm { +namespace lld::wasm { class OutputSection; void writeMapFile(llvm::ArrayRef outputSections); -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/MarkLive.h b/lld/wasm/MarkLive.h --- a/lld/wasm/MarkLive.h +++ b/lld/wasm/MarkLive.h @@ -9,12 +9,10 @@ #ifndef LLD_WASM_MARKLIVE_H #define LLD_WASM_MARKLIVE_H -namespace lld { -namespace wasm { +namespace lld::wasm { void markLive(); -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif // LLD_WASM_MARKLIVE_H diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp --- a/lld/wasm/MarkLive.cpp +++ b/lld/wasm/MarkLive.cpp @@ -30,8 +30,7 @@ using namespace llvm; using namespace llvm::wasm; -namespace lld { -namespace wasm { +namespace lld::wasm { namespace { @@ -205,5 +204,4 @@ return false; } -} // namespace wasm -} // namespace lld +} // namespace lld::wasm diff --git a/lld/wasm/OutputSegment.h b/lld/wasm/OutputSegment.h --- a/lld/wasm/OutputSegment.h +++ b/lld/wasm/OutputSegment.h @@ -13,8 +13,7 @@ #include "lld/Common/ErrorHandler.h" #include "llvm/Object/Wasm.h" -namespace lld { -namespace wasm { +namespace lld::wasm { class InputSegment; @@ -49,7 +48,6 @@ std::string header; }; -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif // LLD_WASM_OUTPUT_SEGMENT_H diff --git a/lld/wasm/OutputSegment.cpp b/lld/wasm/OutputSegment.cpp --- a/lld/wasm/OutputSegment.cpp +++ b/lld/wasm/OutputSegment.cpp @@ -15,9 +15,7 @@ using namespace llvm; using namespace llvm::wasm; -namespace lld { - -namespace wasm { +namespace lld::wasm { void OutputSegment::addInputSegment(InputChunk *inSeg) { alignment = std::max(alignment, inSeg->alignment); @@ -82,5 +80,4 @@ } } -} // namespace wasm -} // namespace lld +} // namespace lld::wasm diff --git a/lld/wasm/Relocations.h b/lld/wasm/Relocations.h --- a/lld/wasm/Relocations.h +++ b/lld/wasm/Relocations.h @@ -9,14 +9,12 @@ #ifndef LLD_WASM_RELOCATIONS_H #define LLD_WASM_RELOCATIONS_H -namespace lld { -namespace wasm { +namespace lld::wasm { class InputChunk; void scanRelocations(InputChunk *chunk); -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/Relocations.cpp b/lld/wasm/Relocations.cpp --- a/lld/wasm/Relocations.cpp +++ b/lld/wasm/Relocations.cpp @@ -16,8 +16,7 @@ using namespace llvm; using namespace llvm::wasm; -namespace lld { -namespace wasm { +namespace lld::wasm { static bool requiresGOTAccess(const Symbol *sym) { if (!config->isPic && @@ -176,5 +175,4 @@ } } -} // namespace wasm -} // namespace lld +} // namespace lld::wasm diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -18,8 +18,7 @@ #include "llvm/BinaryFormat/WasmTraits.h" #include -namespace lld { -namespace wasm { +namespace lld::wasm { class InputSegment; @@ -144,7 +143,6 @@ extern SymbolTable *symtab; -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp --- a/lld/wasm/SymbolTable.cpp +++ b/lld/wasm/SymbolTable.cpp @@ -20,8 +20,7 @@ using namespace llvm::wasm; using namespace llvm::object; -namespace lld { -namespace wasm { +namespace lld::wasm { SymbolTable *symtab; void SymbolTable::addFile(InputFile *file) { @@ -966,5 +965,4 @@ } } -} // namespace wasm -} // namespace lld +} // namespace wasm::lld diff --git a/lld/wasm/SyntheticSections.h b/lld/wasm/SyntheticSections.h --- a/lld/wasm/SyntheticSections.h +++ b/lld/wasm/SyntheticSections.h @@ -24,8 +24,7 @@ #define DEBUG_TYPE "lld" -namespace lld { -namespace wasm { +namespace lld::wasm { // An init entry to be written to either the synthetic init func or the // linking metadata. @@ -127,8 +126,7 @@ lhs.importName == rhs.importName && lhs.type == rhs.type; } -} // namespace wasm -} // namespace lld +} // namespace wasm::lld // `ImportKey` can be used as a key in a `DenseMap` if `T` can be used as a // key in a `DenseMap`. diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp --- a/lld/wasm/SyntheticSections.cpp +++ b/lld/wasm/SyntheticSections.cpp @@ -22,8 +22,7 @@ using namespace llvm; using namespace llvm::wasm; -namespace lld { -namespace wasm { +namespace lld::wasm { OutStruct out; @@ -922,5 +921,4 @@ memcpy(hashPlaceholderPtr, buf.data(), hashSize); } -} // namespace wasm -} // namespace lld +} // namespace wasm::lld diff --git a/lld/wasm/Writer.h b/lld/wasm/Writer.h --- a/lld/wasm/Writer.h +++ b/lld/wasm/Writer.h @@ -9,12 +9,10 @@ #ifndef LLD_WASM_WRITER_H #define LLD_WASM_WRITER_H -namespace lld { -namespace wasm { +namespace lld::wasm { void writeResult(); -} // namespace wasm -} // namespace lld +} // namespace lld::wasm #endif diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -45,8 +45,7 @@ using namespace llvm; using namespace llvm::wasm; -namespace lld { -namespace wasm { +namespace lld::wasm { static constexpr int stackAlignment = 16; static constexpr int heapAlignment = 16; @@ -1865,5 +1864,4 @@ void writeResult() { Writer().run(); } -} // namespace wasm -} // namespace lld +} // namespace wasm::lld