From: Gabe Black Date: Thu, 21 Jan 2021 11:17:40 +0000 (-0800) Subject: arch-mips: Stop "using namespace std" X-Git-Tag: develop-gem5-snapshot~242 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35c4ed086dabb8500ed5f4950c3b4704c2096728;p=gem5.git arch-mips: Stop "using namespace std" Change-Id: I0ad5ad71d8ba2d7c050d3f368341ce98d3f87a90 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39559 Reviewed-by: Daniel Carvalho Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/src/arch/mips/dsp.cc b/src/arch/mips/dsp.cc index 9b0f098f7..73babf1f0 100644 --- a/src/arch/mips/dsp.cc +++ b/src/arch/mips/dsp.cc @@ -35,7 +35,6 @@ #include "sim/serialize.hh" using namespace MipsISA; -using namespace std; int32_t MipsISA::bitrev(int32_t value) diff --git a/src/arch/mips/isa/formats/branch.isa b/src/arch/mips/isa/formats/branch.isa index 42a0dea38..09bab4749 100644 --- a/src/arch/mips/isa/formats/branch.isa +++ b/src/arch/mips/isa/formats/branch.isa @@ -34,7 +34,6 @@ output header {{ #include - using namespace std; /** * Base class for instructions whose disassembly is not purely a diff --git a/src/arch/mips/isa/formats/dsp.isa b/src/arch/mips/isa/formats/dsp.isa index 12af2d61f..fc0895677 100644 --- a/src/arch/mips/isa/formats/dsp.isa +++ b/src/arch/mips/isa/formats/dsp.isa @@ -32,7 +32,6 @@ // output header {{ #include - using namespace std; /** * Base class for integer operations. */ diff --git a/src/arch/mips/isa/formats/int.isa b/src/arch/mips/isa/formats/int.isa index f47e72891..35bbef691 100644 --- a/src/arch/mips/isa/formats/int.isa +++ b/src/arch/mips/isa/formats/int.isa @@ -32,7 +32,6 @@ // output header {{ #include - using namespace std; /** * Base class for integer operations. */ diff --git a/src/arch/mips/isa/formats/util.isa b/src/arch/mips/isa/formats/util.isa index 39ece7a2d..387095515 100644 --- a/src/arch/mips/isa/formats/util.isa +++ b/src/arch/mips/isa/formats/util.isa @@ -80,7 +80,7 @@ output decoder {{ std::string inst2string(MachInst machInst) { - string str = ""; + std::string str = ""; uint32_t mask = 0x80000000; for(int i=0; i < 32; i++) { diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index 44f4f3237..e2f2bb963 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -42,7 +42,6 @@ #include "sim/syscall_return.hh" #include "sim/system.hh" -using namespace std; using namespace MipsISA; MipsProcess::MipsProcess(const ProcessParams ¶ms, @@ -68,9 +67,9 @@ MipsProcess::MipsProcess(const ProcessParams ¶ms, // Set up region for mmaps. Start it 1GB above the top of the heap. Addr mmap_end = brk_point + 0x40000000L; - 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 @@ -126,7 +125,7 @@ MipsProcess::argsInit(int pageSize) int auxv_array_size = intSize * 2 * (auxv.size() + 1); int arg_data_size = 0; - for (vector::size_type i = 0; i < argv.size(); ++i) { + for (std::vector::size_type i = 0; i < argv.size(); ++i) { arg_data_size += argv[i].size() + 1; } @@ -134,7 +133,7 @@ MipsProcess::argsInit(int pageSize) int aux_data_size = numRandomBytes; int env_data_size = 0; - for (vector::size_type i = 0; i < envp.size(); ++i) { + for (std::vector::size_type i = 0; i < envp.size(); ++i) { env_data_size += envp[i].size() + 1; } diff --git a/src/arch/mips/remote_gdb.cc b/src/arch/mips/remote_gdb.cc index bd9a40f68..9d7179231 100644 --- a/src/arch/mips/remote_gdb.cc +++ b/src/arch/mips/remote_gdb.cc @@ -143,7 +143,6 @@ #include "mem/page_table.hh" #include "sim/full_system.hh" -using namespace std; using namespace MipsISA; RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc, int _port) diff --git a/src/arch/mips/tlb.cc b/src/arch/mips/tlb.cc index 3ceb1ae14..5373ba9a1 100644 --- a/src/arch/mips/tlb.cc +++ b/src/arch/mips/tlb.cc @@ -46,7 +46,6 @@ #include "params/MipsTLB.hh" #include "sim/process.hh" -using namespace std; using namespace MipsISA; /////////////////////////////////////////////////////////////////////// @@ -169,7 +168,7 @@ TLB::insertAt(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)); } } @@ -211,7 +210,7 @@ TLB::unserialize(CheckpointIn &cp) ScopedCheckpointSection sec(cp, csprintf("PTE%d", i)); table[i].unserialize(cp); if (table[i].V0 || table[i].V1) { - lookupTable.insert(make_pair(table[i].VPN, i)); + lookupTable.insert(std::make_pair(table[i].VPN, i)); } } } diff --git a/src/arch/mips/utility.cc b/src/arch/mips/utility.cc index 930c36bcf..db4e110d1 100644 --- a/src/arch/mips/utility.cc +++ b/src/arch/mips/utility.cc @@ -39,7 +39,6 @@ #include "sim/serialize.hh" using namespace MipsISA; -using namespace std; namespace MipsISA {