diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h @@ -13,8 +13,7 @@ #undef RISCV -namespace llvm { -namespace RISCV { +namespace llvm::RISCV { enum Fixups { // 20-bit fixup corresponding to %hi(foo) for instructions like lui fixup_riscv_hi20 = FirstTargetFixupKind, @@ -109,7 +108,6 @@ fixup_riscv_invalid, NumTargetFixupKinds = fixup_riscv_invalid - FirstTargetFixupKind }; -} // end namespace RISCV -} // end namespace llvm +} // end namespace llvm::RISCV #endif diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp @@ -172,8 +172,7 @@ return 0; } -namespace llvm { -namespace RISCVMatInt { +namespace llvm::RISCVMatInt { InstSeq generateInstSeq(int64_t Val, const FeatureBitset &ActiveFeatures) { RISCVMatInt::InstSeq Res; generateInstSeqImpl(Val, ActiveFeatures, Res); @@ -419,5 +418,4 @@ } } -} // namespace RISCVMatInt -} // namespace llvm +} // namespace llvm::RISCVMatInt diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -27,8 +27,7 @@ #define DEBUG_TYPE "riscv-isel" -namespace llvm { -namespace RISCV { +namespace llvm::RISCV { #define GET_RISCVVSSEGTable_IMPL #define GET_RISCVVLSEGTable_IMPL #define GET_RISCVVLXSEGTable_IMPL @@ -39,8 +38,7 @@ #define GET_RISCVVSXTable_IMPL #define GET_RISCVMaskedPseudosTable_IMPL #include "RISCVGenSearchableTables.inc" -} // namespace RISCV -} // namespace llvm +} // namespace llvm::RISCV void RISCVDAGToDAGISel::PreprocessISelDAG() { SelectionDAG::allnodes_iterator Position = CurDAG->allnodes_end(); diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -12833,12 +12833,9 @@ return Reg; } -namespace llvm { -namespace RISCVVIntrinsicsTable { +namespace llvm::RISCVVIntrinsicsTable { #define GET_RISCVVIntrinsicsTable_IMPL #include "RISCVGenSearchableTables.inc" -} // namespace RISCVVIntrinsicsTable - -} // namespace llvm +} // namespace llvm::RISCVVIntrinsicsTable diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -42,16 +42,14 @@ "riscv-prefer-whole-register-move", cl::init(false), cl::Hidden, cl::desc("Prefer whole register move for vector registers.")); -namespace llvm { -namespace RISCVVPseudosTable { +namespace llvm::RISCVVPseudosTable { using namespace RISCV; #define GET_RISCVVPseudosTable_IMPL #include "RISCVGenSearchableTables.inc" -} // namespace RISCVVPseudosTable -} // namespace llvm +} // namespace llvm::RISCVVPseudosTable RISCVInstrInfo::RISCVInstrInfo(RISCVSubtarget &STI) : RISCVGenInstrInfo(RISCV::ADJCALLSTACKDOWN, RISCV::ADJCALLSTACKUP),