shafik created this revision.
shafik added reviewers: labath, aprantl, JDevlieghere.
Herald added a project: All.
shafik requested review of this revision.
We had `using namespace std;` sprinkled around several source files and tests.
This also follows the LLVM coding standard
<https://llvm.org/docs/CodingStandards.html#do-not-use-using-namespace-std>.
https://reviews.llvm.org/D120966
Files:
lldb/source/Core/FileSpecList.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/test/API/api/multithreaded/inferior.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
lldb/test/API/functionalities/process_save_core_minidump/main.cpp
lldb/test/API/functionalities/thread/concurrent_events/main.cpp
lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
Index: lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
===================================================================
--- lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
+++ lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
@@ -2,8 +2,6 @@
// Link with "link test-pdb-types.obj /debug /nodefaultlib /entry:main
// /out:test-pdb-types.exe"
-using namespace std;
-
// Sizes of builtin types
static const int sizeof_char = sizeof(char);
static const int sizeof_uchar = sizeof(unsigned char);
Index: lldb/test/API/functionalities/thread/concurrent_events/main.cpp
===================================================================
--- lldb/test/API/functionalities/thread/concurrent_events/main.cpp
+++ lldb/test/API/functionalities/thread/concurrent_events/main.cpp
@@ -6,7 +6,6 @@
#include "pseudo_barrier.h"
#include <vector>
-using namespace std;
#include <pthread.h>
Index: lldb/test/API/functionalities/process_save_core_minidump/main.cpp
===================================================================
--- lldb/test/API/functionalities/process_save_core_minidump/main.cpp
+++ lldb/test/API/functionalities/process_save_core_minidump/main.cpp
@@ -2,8 +2,6 @@
#include <iostream>
#include <thread>
-using namespace std;
-
void g() { assert(false); }
void f() { g(); }
@@ -19,12 +17,12 @@
}
int main() {
- thread t1(f);
+ std::thread t1(f);
size_t x = h();
t1.join();
- cout << "X is " << x << "\n";
+ std::cout << "X is " << x << "\n";
return 0;
-}
\ No newline at end of file
+}
Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
@@ -1,11 +1,9 @@
#include <tuple>
#include <string>
-using namespace std;
-
int main() {
- tuple<> empty;
- tuple<int> one_elt{47};
- tuple<int, long, string> three_elts{1, 47l, "foo"};
+ std::tuple<> empty;
+ std::tuple<int> one_elt{47};
+ std::tuple<int, long, std::string> three_elts{1, 47l, "foo"};
return 0; // break here
}
Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
@@ -1,11 +1,9 @@
#include <queue>
#include <vector>
-using namespace std;
-
int main() {
- queue<int> q1{{1,2,3,4,5}};
- queue<int, std::vector<int>> q2{{1,2,3,4,5}};
+ std::queue<int> q1{{1,2,3,4,5}};
+ std::queue<int, std::vector<int>> q2{{1,2,3,4,5}};
int ret = q1.size() + q2.size(); // break here
return ret;
}
Index: lldb/test/API/api/multithreaded/inferior.cpp
===================================================================
--- lldb/test/API/api/multithreaded/inferior.cpp
+++ lldb/test/API/api/multithreaded/inferior.cpp
@@ -1,11 +1,11 @@
#include <iostream>
-using namespace std;
+
int next() {
static int i = 0;
- cout << "incrementing " << i << endl;
+ std::cout << "incrementing " << i << std::endl;
return ++i;
}
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -26,7 +26,6 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
-using namespace std;
extern int g_verbose;
@@ -449,7 +448,7 @@
uint64_t HeaderSize = llvm::DWARFListTableHeader::getHeaderSize(format);
if (offset < HeaderSize)
- return llvm::createStringError(errc::invalid_argument,
+ return llvm::createStringError(std::errc::invalid_argument,
"did not detect a valid"
" list table with base = 0x%" PRIx64 "\n",
offset);
@@ -559,10 +558,10 @@
// This function is called only for DW_FORM_rnglistx.
llvm::Expected<uint64_t> DWARFUnit::GetRnglistOffset(uint32_t Index) {
if (!GetRnglistTable())
- return llvm::createStringError(errc::invalid_argument,
+ return llvm::createStringError(std::errc::invalid_argument,
"missing or invalid range list table");
if (!m_ranges_base)
- return llvm::createStringError(errc::invalid_argument,
+ return llvm::createStringError(std::errc::invalid_argument,
"DW_FORM_rnglistx cannot be used without "
"DW_AT_rnglists_base for CU at 0x%8.8x",
GetOffset());
@@ -570,7 +569,7 @@
GetRnglistData().GetAsLLVM(), Index))
return *off + m_ranges_base;
return llvm::createStringError(
- errc::invalid_argument,
+ std::errc::invalid_argument,
"invalid range list table index %u; OffsetEntryCount is %u, "
"DW_AT_rnglists_base is %" PRIu64,
Index, GetRnglistTable()->getOffsetEntryCount(), m_ranges_base);
@@ -999,7 +998,7 @@
}
if (!GetRnglistTable())
- return llvm::createStringError(errc::invalid_argument,
+ return llvm::createStringError(std::errc::invalid_argument,
"missing or invalid range list table");
llvm::DWARFDataExtractor data = GetRnglistData().GetAsLLVM();
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -32,7 +32,6 @@
using namespace lldb_private;
using namespace lldb_private::dwarf;
-using namespace std;
extern int g_verbose;
// Extract a debug info entry for a given DWARFUnit from the data
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -27,7 +27,6 @@
using namespace lldb;
using namespace lldb_private;
-using namespace std;
// Constructor
DWARFDebugInfo::DWARFDebugInfo(SymbolFileDWARF &dwarf,
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -12,7 +12,6 @@
using namespace lldb;
using namespace lldb_private;
-using namespace std;
// DWARFAbbreviationDeclarationSet::Clear()
void DWARFAbbreviationDeclarationSet::Clear() {
Index: lldb/source/Core/FileSpecList.cpp
===================================================================
--- lldb/source/Core/FileSpecList.cpp
+++ lldb/source/Core/FileSpecList.cpp
@@ -16,7 +16,6 @@
#include <cstdint>
using namespace lldb_private;
-using namespace std;
FileSpecList::FileSpecList() : m_files() {}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits