Skip to content

Commit 9bd72b5

Browse files
committed
[LLDB] Remove cases of using namespace std
We had using namespace std; sprinkled around several source files and tests. Differential Revision: https://reviews.llvm.org/D120966
1 parent bde13a8 commit 9bd72b5

File tree

11 files changed

+15
-29
lines changed

11 files changed

+15
-29
lines changed

lldb/source/Core/FileSpecList.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <cstdint>
1717

1818
using namespace lldb_private;
19-
using namespace std;
2019

2120
FileSpecList::FileSpecList() : m_files() {}
2221

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
using namespace lldb;
1414
using namespace lldb_private;
15-
using namespace std;
1615

1716
// DWARFAbbreviationDeclarationSet::Clear()
1817
void DWARFAbbreviationDeclarationSet::Clear() {

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
using namespace lldb;
2929
using namespace lldb_private;
30-
using namespace std;
3130

3231
// Constructor
3332
DWARFDebugInfo::DWARFDebugInfo(SymbolFileDWARF &dwarf,

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
using namespace lldb_private;
3434
using namespace lldb_private::dwarf;
35-
using namespace std;
3635
extern int g_verbose;
3736

3837
// Extract a debug info entry for a given DWARFUnit from the data

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
using namespace lldb;
2727
using namespace lldb_private;
2828
using namespace lldb_private::dwarf;
29-
using namespace std;
3029

3130
extern int g_verbose;
3231

@@ -449,7 +448,7 @@ ParseListTableHeader(const llvm::DWARFDataExtractor &data, uint64_t offset,
449448

450449
uint64_t HeaderSize = llvm::DWARFListTableHeader::getHeaderSize(format);
451450
if (offset < HeaderSize)
452-
return llvm::createStringError(errc::invalid_argument,
451+
return llvm::createStringError(std::errc::invalid_argument,
453452
"did not detect a valid"
454453
" list table with base = 0x%" PRIx64 "\n",
455454
offset);
@@ -559,18 +558,18 @@ DWARFUnit::GetRnglistTable() {
559558
// This function is called only for DW_FORM_rnglistx.
560559
llvm::Expected<uint64_t> DWARFUnit::GetRnglistOffset(uint32_t Index) {
561560
if (!GetRnglistTable())
562-
return llvm::createStringError(errc::invalid_argument,
561+
return llvm::createStringError(std::errc::invalid_argument,
563562
"missing or invalid range list table");
564563
if (!m_ranges_base)
565-
return llvm::createStringError(errc::invalid_argument,
564+
return llvm::createStringError(std::errc::invalid_argument,
566565
"DW_FORM_rnglistx cannot be used without "
567566
"DW_AT_rnglists_base for CU at 0x%8.8x",
568567
GetOffset());
569568
if (llvm::Optional<uint64_t> off = GetRnglistTable()->getOffsetEntry(
570569
GetRnglistData().GetAsLLVM(), Index))
571570
return *off + m_ranges_base;
572571
return llvm::createStringError(
573-
errc::invalid_argument,
572+
std::errc::invalid_argument,
574573
"invalid range list table index %u; OffsetEntryCount is %u, "
575574
"DW_AT_rnglists_base is %" PRIu64,
576575
Index, GetRnglistTable()->getOffsetEntryCount(), m_ranges_base);
@@ -999,7 +998,7 @@ DWARFUnit::FindRnglistFromOffset(dw_offset_t offset) {
999998
}
1000999

10011000
if (!GetRnglistTable())
1002-
return llvm::createStringError(errc::invalid_argument,
1001+
return llvm::createStringError(std::errc::invalid_argument,
10031002
"missing or invalid range list table");
10041003

10051004
llvm::DWARFDataExtractor data = GetRnglistData().GetAsLLVM();

lldb/test/API/api/multithreaded/inferior.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
#include <iostream>
33

4-
using namespace std;
4+
55

66
int next() {
77
static int i = 0;
8-
cout << "incrementing " << i << endl;
8+
std::cout << "incrementing " << i << std::endl;
99
return ++i;
1010
}
1111

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#include <queue>
22
#include <vector>
33

4-
using namespace std;
5-
64
int main() {
7-
queue<int> q1{{1,2,3,4,5}};
8-
queue<int, std::vector<int>> q2{{1,2,3,4,5}};
5+
std::queue<int> q1{{1,2,3,4,5}};
6+
std::queue<int, std::vector<int>> q2{{1,2,3,4,5}};
97
int ret = q1.size() + q2.size(); // break here
108
return ret;
119
}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#include <tuple>
22
#include <string>
33

4-
using namespace std;
5-
64
int main() {
7-
tuple<> empty;
8-
tuple<int> one_elt{47};
9-
tuple<int, long, string> three_elts{1, 47l, "foo"};
5+
std::tuple<> empty;
6+
std::tuple<int> one_elt{47};
7+
std::tuple<int, long, std::string> three_elts{1, 47l, "foo"};
108
return 0; // break here
119
}

lldb/test/API/functionalities/process_save_core_minidump/main.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include <iostream>
33
#include <thread>
44

5-
using namespace std;
6-
75
void g() { assert(false); }
86

97
void f() { g(); }
@@ -19,12 +17,12 @@ size_t h() {
1917
}
2018

2119
int main() {
22-
thread t1(f);
20+
std::thread t1(f);
2321

2422
size_t x = h();
2523

2624
t1.join();
2725

28-
cout << "X is " << x << "\n";
26+
std::cout << "X is " << x << "\n";
2927
return 0;
30-
}
28+
}

lldb/test/API/functionalities/thread/concurrent_events/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "pseudo_barrier.h"
88
#include <vector>
9-
using namespace std;
109

1110
#include <pthread.h>
1211

lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Link with "link test-pdb-types.obj /debug /nodefaultlib /entry:main
33
// /out:test-pdb-types.exe"
44

5-
using namespace std;
6-
75
// Sizes of builtin types
86
static const int sizeof_char = sizeof(char);
97
static const int sizeof_uchar = sizeof(unsigned char);

0 commit comments

Comments
 (0)