Skip to content

Commit 8031d81

Browse files
kazutakahirataGeorgeARM
authored andcommitted
[lldb] Remove unused local variables (NFC) (llvm#138457)
1 parent 702dd4d commit 8031d81

File tree

13 files changed

+1
-27
lines changed

13 files changed

+1
-27
lines changed

lldb/source/Commands/CommandObjectCommands.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,9 +1537,8 @@ class CommandObjectScriptingObjectParsed : public CommandObjectParsed {
15371537
option_def.completion_type = (CommandArgumentType) completion_type;
15381538
} else
15391539
option_def.completion_type = eNoCompletion;
1540-
1540+
15411541
// Usage Text:
1542-
std::string usage_text;
15431542
obj_sp = opt_dict->GetValueForKey("help");
15441543
if (!obj_sp) {
15451544
error = Status::FromErrorStringWithFormatv(

lldb/source/Core/FormatEntity.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,6 @@ static void AddMatches(const Definition *def, const llvm::StringRef &prefix,
24712471
const size_t n = def->num_children;
24722472
if (n > 0) {
24732473
for (size_t i = 0; i < n; ++i) {
2474-
std::string match = prefix.str();
24752474
if (match_prefix.empty())
24762475
matches.AppendString(MakeMatch(prefix, def->children[i].name));
24772476
else if (strncmp(def->children[i].name, match_prefix.data(),

lldb/source/DataFormatters/CXXFunctionPointer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ using namespace lldb_private::formatters;
2323

2424
bool lldb_private::formatters::CXXFunctionPointerSummaryProvider(
2525
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
26-
std::string destination;
2726
StreamString sstr;
2827
AddressType func_ptr_address_type = eAddressTypeInvalid;
2928
addr_t func_ptr_address = valobj.GetPointerValue(&func_ptr_address_type);

lldb/source/Expression/DiagnosticManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ std::string DiagnosticManager::GetString(char separator) {
8383
stream << severity;
8484

8585
llvm::StringRef message = diagnostic->GetMessage();
86-
std::string searchable_message = message.lower();
8786
auto severity_pos = message.find(severity);
8887
stream << message.take_front(severity_pos);
8988

lldb/source/Interpreter/CommandObject.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,11 @@ void CommandObject::HandleArgumentCompletion(
338338

339339
}
340340

341-
342341
bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
343342
bool search_short_help,
344343
bool search_long_help,
345344
bool search_syntax,
346345
bool search_options) {
347-
std::string options_usage_help;
348-
349346
bool found_word = false;
350347

351348
llvm::StringRef short_help = GetHelp();

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,6 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
904904
if (!debugserver_file_spec)
905905
return Status::FromErrorString("unable to locate " DEBUGSERVER_BASENAME);
906906

907-
std::string debugserver_path = debugserver_file_spec.GetPath();
908907
launch_info.SetExecutableFile(debugserver_file_spec,
909908
/*add_exe_file_as_first_arg=*/true);
910909

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,6 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
21512151
llvm::StringRef value;
21522152
uint32_t cpu = LLDB_INVALID_CPUTYPE;
21532153
uint32_t sub = 0;
2154-
std::string arch_name;
21552154
std::string os_name;
21562155
std::string environment;
21572156
std::string vendor_name;

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,6 @@ ProcessGDBRemote::SetThreadStopInfo(StructuredData::Dictionary *thread_dict) {
20562056
// Stop with signal and thread info
20572057
lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
20582058
uint8_t signo = 0;
2059-
std::string value;
20602059
std::string thread_name;
20612060
std::string reason;
20622061
std::string description;
@@ -2276,7 +2275,6 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
22762275
m_jstopinfo_sp = StructuredData::ParseJSON(json);
22772276
} else if (key.compare("hexname") == 0) {
22782277
StringExtractor name_extractor(value);
2279-
std::string name;
22802278
// Now convert the HEX bytes into a string value
22812279
name_extractor.GetHexByteString(thread_name);
22822280
} else if (key.compare("name") == 0) {

lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,8 +2567,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand(
25672567

25682568
bool ret_val = false;
25692569

2570-
std::string err_msg;
2571-
25722570
{
25732571
Locker py_lock(this,
25742572
Locker::AcquireLock | Locker::InitSession |
@@ -2612,8 +2610,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand(
26122610

26132611
bool ret_val = false;
26142612

2615-
std::string err_msg;
2616-
26172613
{
26182614
Locker py_lock(this,
26192615
Locker::AcquireLock | Locker::InitSession |
@@ -2657,8 +2653,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedParsedCommand(
26572653

26582654
bool ret_val = false;
26592655

2660-
std::string err_msg;
2661-
26622656
{
26632657
Locker py_lock(this,
26642658
Locker::AcquireLock | Locker::InitSession |
@@ -3166,8 +3160,6 @@ void ScriptInterpreterPythonImpl::Initialize() {
31663160

31673161
void ScriptInterpreterPythonImpl::AddToSysPath(AddLocation location,
31683162
std::string path) {
3169-
std::string path_copy;
3170-
31713163
std::string statement;
31723164
if (location == AddLocation::Beginning) {
31733165
statement.assign("sys.path.insert(0,\"");

lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) {
177177
// name until we find it, and we can cache that one since the memory is backed
178178
// by a contiguous chunk inside the mapped PDB.
179179
llvm::SmallString<64> main_file = GetMainSourceFile(*cci);
180-
std::string s = std::string(main_file.str());
181180
llvm::sys::path::native(main_file);
182181

183182
uint32_t file_count = modules.getSourceFileCount(modi);

lldb/source/Target/Platform.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ Status Platform::Install(const FileSpec &src, const FileSpec &dst) {
492492
// the platform's working directory
493493
if (!fixed_dst.GetDirectory()) {
494494
FileSpec relative_spec;
495-
std::string path;
496495
if (working_dir) {
497496
relative_spec = working_dir;
498497
relative_spec.AppendPathComponent(dst.GetPath());

lldb/source/Utility/ArchSpec.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,6 @@ bool ArchSpec::IsFullySpecifiedTriple() const {
14551455
}
14561456

14571457
bool ArchSpec::IsAlwaysThumbInstructions() const {
1458-
std::string Status;
14591458
if (GetTriple().getArch() == llvm::Triple::arm ||
14601459
GetTriple().getArch() == llvm::Triple::thumb) {
14611460
// v. https://en.wikipedia.org/wiki/ARM_Cortex-M

lldb/unittests/Utility/LogTest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ TEST(LogTest, Unregister) {
160160
llvm::llvm_shutdown_obj obj;
161161
Log::Register("chan", test_channel);
162162
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
163-
std::string message;
164163
auto log_handler_sp = std::make_shared<TestLogHandler>();
165164
EXPECT_TRUE(
166165
Log::EnableLogChannel(log_handler_sp, 0, "chan", {"foo"}, llvm::nulls()));
@@ -214,7 +213,6 @@ TEST(LogHandlerTest, TeeLogHandler) {
214213

215214
TEST_F(LogChannelTest, Enable) {
216215
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
217-
std::string message;
218216
auto log_handler_sp = std::make_shared<TestLogHandler>();
219217
std::string error;
220218
ASSERT_FALSE(EnableChannel(log_handler_sp, 0, "chanchan", {}, error));
@@ -236,7 +234,6 @@ TEST_F(LogChannelTest, Enable) {
236234

237235
TEST_F(LogChannelTest, EnableOptions) {
238236
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
239-
std::string message;
240237
auto log_handler_sp = std::make_shared<TestLogHandler>();
241238
std::string error;
242239
EXPECT_TRUE(EnableChannel(log_handler_sp, LLDB_LOG_OPTION_VERBOSE, "chan", {},
@@ -249,7 +246,6 @@ TEST_F(LogChannelTest, EnableOptions) {
249246

250247
TEST_F(LogChannelTest, Disable) {
251248
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
252-
std::string message;
253249
auto log_handler_sp = std::make_shared<TestLogHandler>();
254250
std::string error;
255251
EXPECT_TRUE(EnableChannel(log_handler_sp, 0, "chan", {"foo", "bar"}, error));

0 commit comments

Comments
 (0)