diff --git a/lld/ELF/AArch64ErrataFix.h b/lld/ELF/AArch64ErrataFix.h --- a/lld/ELF/AArch64ErrataFix.h +++ b/lld/ELF/AArch64ErrataFix.h @@ -13,8 +13,7 @@ #include "llvm/ADT/DenseMap.h" #include -namespace lld { -namespace elf { +namespace lld::elf { class Defined; class InputSection; @@ -43,7 +42,6 @@ bool initialized = false; }; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/ARMErrataFix.h b/lld/ELF/ARMErrataFix.h --- a/lld/ELF/ARMErrataFix.h +++ b/lld/ELF/ARMErrataFix.h @@ -13,8 +13,7 @@ #include "llvm/ADT/DenseMap.h" #include -namespace lld { -namespace elf { +namespace lld::elf { class Defined; class InputSection; @@ -43,7 +42,6 @@ bool initialized = false; }; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/CallGraphSort.h b/lld/ELF/CallGraphSort.h --- a/lld/ELF/CallGraphSort.h +++ b/lld/ELF/CallGraphSort.h @@ -11,12 +11,10 @@ #include "llvm/ADT/DenseMap.h" -namespace lld { -namespace elf { +namespace lld::elf { class InputSectionBase; llvm::DenseMap computeCallGraphProfileOrder(); -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h --- a/lld/ELF/Config.h +++ b/lld/ELF/Config.h @@ -26,8 +26,7 @@ #include #include -namespace lld { -namespace elf { +namespace lld::elf { class InputFile; class BinaryFile; @@ -419,7 +418,6 @@ llvm::getBugReportMsg()); } -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/DWARF.h b/lld/ELF/DWARF.h --- a/lld/ELF/DWARF.h +++ b/lld/ELF/DWARF.h @@ -14,8 +14,7 @@ #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/Object/ELF.h" -namespace lld { -namespace elf { +namespace lld::elf { class InputSection; @@ -100,7 +99,6 @@ StringRef lineStrSection; }; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/Driver.h b/lld/ELF/Driver.h --- a/lld/ELF/Driver.h +++ b/lld/ELF/Driver.h @@ -15,8 +15,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Option/ArgList.h" -namespace lld { -namespace elf { +namespace lld::elf { class InputFile; extern std::unique_ptr driver; @@ -71,7 +70,6 @@ llvm::Optional searchLibraryBaseName(StringRef path); llvm::Optional searchLibrary(StringRef path); -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/EhFrame.h b/lld/ELF/EhFrame.h --- a/lld/ELF/EhFrame.h +++ b/lld/ELF/EhFrame.h @@ -11,13 +11,11 @@ #include "lld/Common/LLVM.h" -namespace lld { -namespace elf { +namespace lld::elf { struct EhSectionPiece; uint8_t getFdeEncoding(EhSectionPiece *p); bool hasLSDA(const EhSectionPiece &p); -} // namespace elf -} // namespace lld +} #endif diff --git a/lld/ELF/ICF.h b/lld/ELF/ICF.h --- a/lld/ELF/ICF.h +++ b/lld/ELF/ICF.h @@ -9,12 +9,10 @@ #ifndef LLD_ELF_ICF_H #define LLD_ELF_ICF_H -namespace lld { -namespace elf { +namespace lld::elf { template void doIcf(); -} // namespace elf -} // namespace lld +} #endif diff --git a/lld/ELF/LTO.h b/lld/ELF/LTO.h --- a/lld/ELF/LTO.h +++ b/lld/ELF/LTO.h @@ -27,14 +27,11 @@ #include #include -namespace llvm { -namespace lto { +namespace llvm::lto { class LTO; } -} // namespace llvm -namespace lld { -namespace elf { +namespace lld::elf { class BitcodeFile; class InputFile; @@ -55,7 +52,6 @@ std::unique_ptr indexFile; llvm::DenseSet thinIndices; }; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -22,8 +22,7 @@ #include #include -namespace lld { -namespace elf { +namespace lld::elf { class Defined; class InputFile; @@ -365,7 +364,6 @@ extern std::unique_ptr script; -} // end namespace elf -} // end namespace lld +} // end namespace lld::elf #endif // LLD_ELF_LINKER_SCRIPT_H diff --git a/lld/ELF/MapFile.h b/lld/ELF/MapFile.h --- a/lld/ELF/MapFile.h +++ b/lld/ELF/MapFile.h @@ -9,10 +9,8 @@ #ifndef LLD_ELF_MAPFILE_H #define LLD_ELF_MAPFILE_H -namespace lld { -namespace elf { +namespace lld::elf { void writeMapAndCref(); -} // namespace elf -} // namespace lld +} #endif diff --git a/lld/ELF/MarkLive.h b/lld/ELF/MarkLive.h --- a/lld/ELF/MarkLive.h +++ b/lld/ELF/MarkLive.h @@ -9,12 +9,10 @@ #ifndef LLD_ELF_MARKLIVE_H #define LLD_ELF_MARKLIVE_H -namespace lld { -namespace elf { +namespace lld::elf { template void markLive(); -} // namespace elf -} // namespace lld +} #endif // LLD_ELF_MARKLIVE_H diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -15,8 +15,7 @@ #include -namespace lld { -namespace elf { +namespace lld::elf { struct PhdrEntry; @@ -154,7 +153,6 @@ uint64_t getHeaderSize(); extern llvm::SmallVector outputSections; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/Relocations.h b/lld/ELF/Relocations.h --- a/lld/ELF/Relocations.h +++ b/lld/ELF/Relocations.h @@ -14,8 +14,7 @@ #include "llvm/ADT/STLExtras.h" #include -namespace lld { -namespace elf { +namespace lld::elf { class Symbol; class InputSection; class InputSectionBase; @@ -212,7 +211,6 @@ } return rels; } -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/ScriptLexer.h b/lld/ELF/ScriptLexer.h --- a/lld/ELF/ScriptLexer.h +++ b/lld/ELF/ScriptLexer.h @@ -14,8 +14,7 @@ #include "llvm/Support/MemoryBufferRef.h" #include -namespace lld { -namespace elf { +namespace lld::elf { class ScriptLexer { public: @@ -52,7 +51,6 @@ size_t getColumnNumber(); }; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/ScriptParser.h b/lld/ELF/ScriptParser.h --- a/lld/ELF/ScriptParser.h +++ b/lld/ELF/ScriptParser.h @@ -12,8 +12,7 @@ #include "lld/Common/LLVM.h" #include "llvm/Support/MemoryBufferRef.h" -namespace lld { -namespace elf { +namespace lld::elf { // Parses a linker script. Calling this function updates // lld::elf::config and lld::elf::script. @@ -29,7 +28,6 @@ bool hasWildcard(StringRef s); -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/SymbolTable.h b/lld/ELF/SymbolTable.h --- a/lld/ELF/SymbolTable.h +++ b/lld/ELF/SymbolTable.h @@ -13,8 +13,7 @@ #include "llvm/ADT/CachedHashString.h" #include "llvm/ADT/DenseMap.h" -namespace lld { -namespace elf { +namespace lld::elf { class InputFile; class SharedFile; @@ -86,7 +85,6 @@ extern std::unique_ptr symtab; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -28,8 +28,7 @@ #include "llvm/Support/Endian.h" #include "llvm/Support/Threading.h" -namespace lld { -namespace elf { +namespace lld::elf { class Defined; struct PhdrEntry; class SymbolTableBaseSection; @@ -1267,7 +1266,6 @@ extern InStruct in; -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/Thunks.h b/lld/ELF/Thunks.h --- a/lld/ELF/Thunks.h +++ b/lld/ELF/Thunks.h @@ -12,8 +12,7 @@ #include "llvm/ADT/SmallVector.h" #include "Relocations.h" -namespace lld { -namespace elf { +namespace lld::elf { class Defined; class InputFile; class Symbol; @@ -78,7 +77,6 @@ return (toCompute + 0x8000) >> 16; } -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h --- a/lld/ELF/Writer.h +++ b/lld/ELF/Writer.h @@ -13,8 +13,7 @@ #include "llvm/ADT/StringRef.h" #include -namespace lld { -namespace elf { +namespace lld::elf { class InputFile; class OutputSection; void copySectionsIntoPartitions(); @@ -56,7 +55,6 @@ bool isMipsN32Abi(const InputFile *f); bool isMicroMips(); bool isMipsR6(); -} // namespace elf -} // namespace lld +} // namespace lld::elf #endif