From 7594dc0715c2be26ba32bfedcd09faa3fb445d35 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 21 Jan 2021 02:58:31 -0800 Subject: [PATCH] arch-power: Stop "using namespace std" Change-Id: Iab8acba7c01a873db660304bb85661e75ffbe854 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39556 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Daniel Carvalho --- src/arch/power/insts/integer.cc | 21 ++++++++++----------- src/arch/power/process.cc | 11 +++++------ src/arch/power/remote_gdb.cc | 1 - src/arch/power/tlb.cc | 5 ++--- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/arch/power/insts/integer.cc b/src/arch/power/insts/integer.cc index 8522153e2..febd469c4 100644 --- a/src/arch/power/insts/integer.cc +++ b/src/arch/power/insts/integer.cc @@ -28,19 +28,18 @@ #include "arch/power/insts/integer.hh" -using namespace std; using namespace PowerISA; -string +std::string IntOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const { - stringstream ss; + std::stringstream ss; bool printDest = true; bool printSrcs = true; bool printSecondSrc = true; // Generate the correct mnemonic - string myMnemonic(mnemonic); + std::string myMnemonic(mnemonic); // Special cases if (!myMnemonic.compare("or") && srcRegIdx(0) == srcRegIdx(1)) { @@ -78,13 +77,13 @@ IntOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const } -string +std::string IntImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const { - stringstream ss; + std::stringstream ss; // Generate the correct mnemonic - string myMnemonic(mnemonic); + std::string myMnemonic(mnemonic); // Special cases if (!myMnemonic.compare("addi") && _numSrcRegs == 0) { @@ -114,11 +113,11 @@ IntImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const } -string +std::string IntShiftOp::generateDisassembly( Addr pc, const Loader::SymbolTable *symtab) const { - stringstream ss; + std::stringstream ss; ccprintf(ss, "%-10s ", mnemonic); @@ -142,11 +141,11 @@ IntShiftOp::generateDisassembly( } -string +std::string IntRotateOp::generateDisassembly( Addr pc, const Loader::SymbolTable *symtab) const { - stringstream ss; + std::stringstream ss; ccprintf(ss, "%-10s ", mnemonic); diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index 9e8d2ad6d..26d28a842 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -43,7 +43,6 @@ #include "sim/syscall_return.hh" #include "sim/system.hh" -using namespace std; using namespace PowerISA; PowerProcess::PowerProcess( @@ -67,9 +66,9 @@ PowerProcess::PowerProcess( // Set up region for mmaps. For now, start at bottom of kuseg space. Addr mmap_end = 0x70000000L; - memState = make_shared(this, brk_point, stack_base, - max_stack_size, next_thread_stack_base, - mmap_end); + memState = std::make_shared( + this, brk_point, stack_base, max_stack_size, + next_thread_stack_base, mmap_end); } void @@ -85,7 +84,7 @@ PowerProcess::argsInit(int intSize, int pageSize) { std::vector> auxv; - string filename; + std::string filename; if (argv.size() < 1) filename = ""; else @@ -146,7 +145,7 @@ PowerProcess::argsInit(int intSize, int pageSize) // A sentry NULL void pointer at the top of the stack. int sentry_size = intSize; - string platform = "v51"; + std::string platform = "v51"; int platform_size = platform.size() + 1; // The aux vectors are put on the stack in two groups. The first group are diff --git a/src/arch/power/remote_gdb.cc b/src/arch/power/remote_gdb.cc index 661c4310e..ce9976fac 100644 --- a/src/arch/power/remote_gdb.cc +++ b/src/arch/power/remote_gdb.cc @@ -143,7 +143,6 @@ #include "mem/page_table.hh" #include "sim/byteswap.hh" -using namespace std; using namespace PowerISA; RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc, int _port) diff --git a/src/arch/power/tlb.cc b/src/arch/power/tlb.cc index dd3b50a12..dca8d7bed 100644 --- a/src/arch/power/tlb.cc +++ b/src/arch/power/tlb.cc @@ -48,7 +48,6 @@ #include "sim/full_system.hh" #include "sim/process.hh" -using namespace std; using namespace PowerISA; /////////////////////////////////////////////////////////////////////// @@ -168,7 +167,7 @@ TLB::insertAt(PowerISA::PTE &pte, unsigned Index, int _smallPages) table[Index]=pte; // Update fast lookup table - lookupTable.insert(make_pair(table[Index].VPN, Index)); + lookupTable.insert(std::make_pair(table[Index].VPN, Index)); } } @@ -209,7 +208,7 @@ TLB::unserialize(CheckpointIn &cp) for (int i = 0; i < size; i++) { ScopedCheckpointSection sec(cp, csprintf("PTE%d", i)); if (table[i].V0 || table[i].V1) { - lookupTable.insert(make_pair(table[i].VPN, i)); + lookupTable.insert(std::make_pair(table[i].VPN, i)); } } } -- 2.30.2