[lldb] Remove unused local variables (NFC) (#138457)
This commit is contained in:
@@ -1537,9 +1537,8 @@ private:
|
||||
option_def.completion_type = (CommandArgumentType) completion_type;
|
||||
} else
|
||||
option_def.completion_type = eNoCompletion;
|
||||
|
||||
|
||||
// Usage Text:
|
||||
std::string usage_text;
|
||||
obj_sp = opt_dict->GetValueForKey("help");
|
||||
if (!obj_sp) {
|
||||
error = Status::FromErrorStringWithFormatv(
|
||||
|
||||
@@ -2471,7 +2471,6 @@ static void AddMatches(const Definition *def, const llvm::StringRef &prefix,
|
||||
const size_t n = def->num_children;
|
||||
if (n > 0) {
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
std::string match = prefix.str();
|
||||
if (match_prefix.empty())
|
||||
matches.AppendString(MakeMatch(prefix, def->children[i].name));
|
||||
else if (strncmp(def->children[i].name, match_prefix.data(),
|
||||
|
||||
@@ -23,7 +23,6 @@ using namespace lldb_private::formatters;
|
||||
|
||||
bool lldb_private::formatters::CXXFunctionPointerSummaryProvider(
|
||||
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
|
||||
std::string destination;
|
||||
StreamString sstr;
|
||||
AddressType func_ptr_address_type = eAddressTypeInvalid;
|
||||
addr_t func_ptr_address = valobj.GetPointerValue(&func_ptr_address_type);
|
||||
|
||||
@@ -83,7 +83,6 @@ std::string DiagnosticManager::GetString(char separator) {
|
||||
stream << severity;
|
||||
|
||||
llvm::StringRef message = diagnostic->GetMessage();
|
||||
std::string searchable_message = message.lower();
|
||||
auto severity_pos = message.find(severity);
|
||||
stream << message.take_front(severity_pos);
|
||||
|
||||
|
||||
@@ -338,14 +338,11 @@ void CommandObject::HandleArgumentCompletion(
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
|
||||
bool search_short_help,
|
||||
bool search_long_help,
|
||||
bool search_syntax,
|
||||
bool search_options) {
|
||||
std::string options_usage_help;
|
||||
|
||||
bool found_word = false;
|
||||
|
||||
llvm::StringRef short_help = GetHelp();
|
||||
|
||||
@@ -904,7 +904,6 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
|
||||
if (!debugserver_file_spec)
|
||||
return Status::FromErrorString("unable to locate " DEBUGSERVER_BASENAME);
|
||||
|
||||
std::string debugserver_path = debugserver_file_spec.GetPath();
|
||||
launch_info.SetExecutableFile(debugserver_file_spec,
|
||||
/*add_exe_file_as_first_arg=*/true);
|
||||
|
||||
|
||||
@@ -2151,7 +2151,6 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
|
||||
llvm::StringRef value;
|
||||
uint32_t cpu = LLDB_INVALID_CPUTYPE;
|
||||
uint32_t sub = 0;
|
||||
std::string arch_name;
|
||||
std::string os_name;
|
||||
std::string environment;
|
||||
std::string vendor_name;
|
||||
|
||||
@@ -2056,7 +2056,6 @@ ProcessGDBRemote::SetThreadStopInfo(StructuredData::Dictionary *thread_dict) {
|
||||
// Stop with signal and thread info
|
||||
lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
|
||||
uint8_t signo = 0;
|
||||
std::string value;
|
||||
std::string thread_name;
|
||||
std::string reason;
|
||||
std::string description;
|
||||
@@ -2276,7 +2275,6 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
|
||||
m_jstopinfo_sp = StructuredData::ParseJSON(json);
|
||||
} else if (key.compare("hexname") == 0) {
|
||||
StringExtractor name_extractor(value);
|
||||
std::string name;
|
||||
// Now convert the HEX bytes into a string value
|
||||
name_extractor.GetHexByteString(thread_name);
|
||||
} else if (key.compare("name") == 0) {
|
||||
|
||||
@@ -2567,8 +2567,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand(
|
||||
|
||||
bool ret_val = false;
|
||||
|
||||
std::string err_msg;
|
||||
|
||||
{
|
||||
Locker py_lock(this,
|
||||
Locker::AcquireLock | Locker::InitSession |
|
||||
@@ -2612,8 +2610,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand(
|
||||
|
||||
bool ret_val = false;
|
||||
|
||||
std::string err_msg;
|
||||
|
||||
{
|
||||
Locker py_lock(this,
|
||||
Locker::AcquireLock | Locker::InitSession |
|
||||
@@ -2657,8 +2653,6 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedParsedCommand(
|
||||
|
||||
bool ret_val = false;
|
||||
|
||||
std::string err_msg;
|
||||
|
||||
{
|
||||
Locker py_lock(this,
|
||||
Locker::AcquireLock | Locker::InitSession |
|
||||
@@ -3166,8 +3160,6 @@ void ScriptInterpreterPythonImpl::Initialize() {
|
||||
|
||||
void ScriptInterpreterPythonImpl::AddToSysPath(AddLocation location,
|
||||
std::string path) {
|
||||
std::string path_copy;
|
||||
|
||||
std::string statement;
|
||||
if (location == AddLocation::Beginning) {
|
||||
statement.assign("sys.path.insert(0,\"");
|
||||
|
||||
@@ -177,7 +177,6 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) {
|
||||
// name until we find it, and we can cache that one since the memory is backed
|
||||
// by a contiguous chunk inside the mapped PDB.
|
||||
llvm::SmallString<64> main_file = GetMainSourceFile(*cci);
|
||||
std::string s = std::string(main_file.str());
|
||||
llvm::sys::path::native(main_file);
|
||||
|
||||
uint32_t file_count = modules.getSourceFileCount(modi);
|
||||
|
||||
@@ -492,7 +492,6 @@ Status Platform::Install(const FileSpec &src, const FileSpec &dst) {
|
||||
// the platform's working directory
|
||||
if (!fixed_dst.GetDirectory()) {
|
||||
FileSpec relative_spec;
|
||||
std::string path;
|
||||
if (working_dir) {
|
||||
relative_spec = working_dir;
|
||||
relative_spec.AppendPathComponent(dst.GetPath());
|
||||
|
||||
@@ -1455,7 +1455,6 @@ bool ArchSpec::IsFullySpecifiedTriple() const {
|
||||
}
|
||||
|
||||
bool ArchSpec::IsAlwaysThumbInstructions() const {
|
||||
std::string Status;
|
||||
if (GetTriple().getArch() == llvm::Triple::arm ||
|
||||
GetTriple().getArch() == llvm::Triple::thumb) {
|
||||
// v. https://en.wikipedia.org/wiki/ARM_Cortex-M
|
||||
|
||||
@@ -160,7 +160,6 @@ TEST(LogTest, Unregister) {
|
||||
llvm::llvm_shutdown_obj obj;
|
||||
Log::Register("chan", test_channel);
|
||||
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
|
||||
std::string message;
|
||||
auto log_handler_sp = std::make_shared<TestLogHandler>();
|
||||
EXPECT_TRUE(
|
||||
Log::EnableLogChannel(log_handler_sp, 0, "chan", {"foo"}, llvm::nulls()));
|
||||
@@ -214,7 +213,6 @@ TEST(LogHandlerTest, TeeLogHandler) {
|
||||
|
||||
TEST_F(LogChannelTest, Enable) {
|
||||
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
|
||||
std::string message;
|
||||
auto log_handler_sp = std::make_shared<TestLogHandler>();
|
||||
std::string error;
|
||||
ASSERT_FALSE(EnableChannel(log_handler_sp, 0, "chanchan", {}, error));
|
||||
@@ -236,7 +234,6 @@ TEST_F(LogChannelTest, Enable) {
|
||||
|
||||
TEST_F(LogChannelTest, EnableOptions) {
|
||||
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
|
||||
std::string message;
|
||||
auto log_handler_sp = std::make_shared<TestLogHandler>();
|
||||
std::string error;
|
||||
EXPECT_TRUE(EnableChannel(log_handler_sp, LLDB_LOG_OPTION_VERBOSE, "chan", {},
|
||||
@@ -249,7 +246,6 @@ TEST_F(LogChannelTest, EnableOptions) {
|
||||
|
||||
TEST_F(LogChannelTest, Disable) {
|
||||
EXPECT_EQ(nullptr, GetLog(TestChannel::FOO));
|
||||
std::string message;
|
||||
auto log_handler_sp = std::make_shared<TestLogHandler>();
|
||||
std::string error;
|
||||
EXPECT_TRUE(EnableChannel(log_handler_sp, 0, "chan", {"foo", "bar"}, error));
|
||||
|
||||
Reference in New Issue
Block a user