Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/39559 )
Change subject: arch-mips: Stop "using namespace std"
......................................................................
arch-mips: Stop "using namespace std"
Change-Id: I0ad5ad71d8ba2d7c050d3f368341ce98d3f87a90
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39559
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/mips/dsp.cc
M src/arch/mips/isa/formats/branch.isa
M src/arch/mips/isa/formats/dsp.isa
M src/arch/mips/isa/formats/int.isa
M src/arch/mips/isa/formats/util.isa
M src/arch/mips/process.cc
M src/arch/mips/remote_gdb.cc
M src/arch/mips/tlb.cc
M src/arch/mips/utility.cc
9 files changed, 8 insertions(+), 16 deletions(-)
Approvals:
Daniel Carvalho: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/mips/dsp.cc b/src/arch/mips/dsp.cc
index 9b0f098..73babf1 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 42a0dea..09bab47 100644
--- a/src/arch/mips/isa/formats/branch.isa
+++ b/src/arch/mips/isa/formats/branch.isa
@@ -34,7 +34,6 @@
output header {{
#include <iostream>
- 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 12af2d6..fc08956 100644
--- a/src/arch/mips/isa/formats/dsp.isa
+++ b/src/arch/mips/isa/formats/dsp.isa
@@ -32,7 +32,6 @@
//
output header {{
#include <iostream>
- 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 f47e728..35bbef6 100644
--- a/src/arch/mips/isa/formats/int.isa
+++ b/src/arch/mips/isa/formats/int.isa
@@ -32,7 +32,6 @@
//
output header {{
#include <iostream>
- 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 39ece7a..3870955 100644
--- a/src/arch/mips/isa/formats/util.isa
+++ b/src/arch/mips/isa/formats/util.isa
@@ -80,7 +80,7 @@
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 44f4f32..e2f2bb9 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 @@
// Set up region for mmaps. Start it 1GB above the top of the heap.
Addr mmap_end = brk_point + 0x40000000L;
- memState = make_shared<MemState>(this, brk_point, stack_base,
- max_stack_size,
next_thread_stack_base,
- mmap_end);
+ memState = std::make_shared<MemState>(
+ this, brk_point, stack_base, max_stack_size,
+ next_thread_stack_base, mmap_end);
}
void
@@ -126,7 +125,7 @@
int auxv_array_size = intSize * 2 * (auxv.size() + 1);
int arg_data_size = 0;
- for (vector<string>::size_type i = 0; i < argv.size(); ++i) {
+ for (std::vector<std::string>::size_type i = 0; i < argv.size(); ++i) {
arg_data_size += argv[i].size() + 1;
}
@@ -134,7 +133,7 @@
int aux_data_size = numRandomBytes;
int env_data_size = 0;
- for (vector<string>::size_type i = 0; i < envp.size(); ++i) {
+ for (std::vector<std::string>::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 bd9a40f..9d71792 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 3ceb1ae..5373ba9 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 @@
}
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 @@
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 930c36b..db4e110 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 {
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39559
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I0ad5ad71d8ba2d7c050d3f368341ce98d3f87a90
Gerrit-Change-Number: 39559
Gerrit-PatchSet: 7
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s