[Lldb-commits] [lldb] r296717 - Fix various warnings. NFC
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 1 16:05:25 PST 2017
Author: zturner
Date: Wed Mar 1 18:05:25 2017
New Revision: 296717
URL: http://llvm.org/viewvc/llvm-project?rev=296717&view=rev
Log:
Fix various warnings. NFC
Modified:
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Utility/VASprintf.cpp
Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Wed Mar 1 18:05:25 2017
@@ -194,10 +194,9 @@ protected:
const bool qualify_cxx_base_classes = false;
- DumpValueObjectOptions::DeclPrintingHelper helper =
- [&valobj_sp, qualify_cxx_base_classes](
- ConstString type, ConstString var,
- const DumpValueObjectOptions &opts, Stream &stream) -> bool {
+ DumpValueObjectOptions::DeclPrintingHelper helper = [&valobj_sp](
+ ConstString type, ConstString var, const DumpValueObjectOptions &opts,
+ Stream &stream) -> bool {
const ValueObject::GetExpressionPathFormat format = ValueObject::
GetExpressionPathFormat::eGetExpressionPathFormatHonorPointers;
valobj_sp->GetExpressionPath(stream, qualify_cxx_base_classes, format);
Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Wed Mar 1 18:05:25 2017
@@ -1188,8 +1188,7 @@ protected:
category_closure(category_sp);
} else {
DataVisualization::Categories::ForEach(
- [this, &command, &result, &category_regex, &formatter_regex,
- &category_closure](
+ [&category_regex, &category_closure](
const lldb::TypeCategoryImplSP &category) -> bool {
if (category_regex) {
bool escape = true;
Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Wed Mar 1 18:05:25 2017
@@ -44,358 +44,6 @@ using namespace lldb_private;
//
//----------------------------------------------------------------------
-static const char *GetARMDWARFRegisterName(unsigned reg_num) {
- switch (reg_num) {
- case dwarf_r0:
- return "r0";
- case dwarf_r1:
- return "r1";
- case dwarf_r2:
- return "r2";
- case dwarf_r3:
- return "r3";
- case dwarf_r4:
- return "r4";
- case dwarf_r5:
- return "r5";
- case dwarf_r6:
- return "r6";
- case dwarf_r7:
- return "r7";
- case dwarf_r8:
- return "r8";
- case dwarf_r9:
- return "r9";
- case dwarf_r10:
- return "r10";
- case dwarf_r11:
- return "r11";
- case dwarf_r12:
- return "r12";
- case dwarf_sp:
- return "sp";
- case dwarf_lr:
- return "lr";
- case dwarf_pc:
- return "pc";
- case dwarf_cpsr:
- return "cpsr";
-
- case dwarf_s0:
- return "s0";
- case dwarf_s1:
- return "s1";
- case dwarf_s2:
- return "s2";
- case dwarf_s3:
- return "s3";
- case dwarf_s4:
- return "s4";
- case dwarf_s5:
- return "s5";
- case dwarf_s6:
- return "s6";
- case dwarf_s7:
- return "s7";
- case dwarf_s8:
- return "s8";
- case dwarf_s9:
- return "s9";
- case dwarf_s10:
- return "s10";
- case dwarf_s11:
- return "s11";
- case dwarf_s12:
- return "s12";
- case dwarf_s13:
- return "s13";
- case dwarf_s14:
- return "s14";
- case dwarf_s15:
- return "s15";
- case dwarf_s16:
- return "s16";
- case dwarf_s17:
- return "s17";
- case dwarf_s18:
- return "s18";
- case dwarf_s19:
- return "s19";
- case dwarf_s20:
- return "s20";
- case dwarf_s21:
- return "s21";
- case dwarf_s22:
- return "s22";
- case dwarf_s23:
- return "s23";
- case dwarf_s24:
- return "s24";
- case dwarf_s25:
- return "s25";
- case dwarf_s26:
- return "s26";
- case dwarf_s27:
- return "s27";
- case dwarf_s28:
- return "s28";
- case dwarf_s29:
- return "s29";
- case dwarf_s30:
- return "s30";
- case dwarf_s31:
- return "s31";
-
- // FPA Registers 0-7
- case dwarf_f0:
- return "f0";
- case dwarf_f1:
- return "f1";
- case dwarf_f2:
- return "f2";
- case dwarf_f3:
- return "f3";
- case dwarf_f4:
- return "f4";
- case dwarf_f5:
- return "f5";
- case dwarf_f6:
- return "f6";
- case dwarf_f7:
- return "f7";
-
- // Intel wireless MMX general purpose registers 0 - 7
- // XScale accumulator register 0 - 7 (they do overlap with wCGR0 - wCGR7)
- case dwarf_wCGR0:
- return "wCGR0/ACC0";
- case dwarf_wCGR1:
- return "wCGR1/ACC1";
- case dwarf_wCGR2:
- return "wCGR2/ACC2";
- case dwarf_wCGR3:
- return "wCGR3/ACC3";
- case dwarf_wCGR4:
- return "wCGR4/ACC4";
- case dwarf_wCGR5:
- return "wCGR5/ACC5";
- case dwarf_wCGR6:
- return "wCGR6/ACC6";
- case dwarf_wCGR7:
- return "wCGR7/ACC7";
-
- // Intel wireless MMX data registers 0 - 15
- case dwarf_wR0:
- return "wR0";
- case dwarf_wR1:
- return "wR1";
- case dwarf_wR2:
- return "wR2";
- case dwarf_wR3:
- return "wR3";
- case dwarf_wR4:
- return "wR4";
- case dwarf_wR5:
- return "wR5";
- case dwarf_wR6:
- return "wR6";
- case dwarf_wR7:
- return "wR7";
- case dwarf_wR8:
- return "wR8";
- case dwarf_wR9:
- return "wR9";
- case dwarf_wR10:
- return "wR10";
- case dwarf_wR11:
- return "wR11";
- case dwarf_wR12:
- return "wR12";
- case dwarf_wR13:
- return "wR13";
- case dwarf_wR14:
- return "wR14";
- case dwarf_wR15:
- return "wR15";
-
- case dwarf_spsr:
- return "spsr";
- case dwarf_spsr_fiq:
- return "spsr_fiq";
- case dwarf_spsr_irq:
- return "spsr_irq";
- case dwarf_spsr_abt:
- return "spsr_abt";
- case dwarf_spsr_und:
- return "spsr_und";
- case dwarf_spsr_svc:
- return "spsr_svc";
-
- case dwarf_r8_usr:
- return "r8_usr";
- case dwarf_r9_usr:
- return "r9_usr";
- case dwarf_r10_usr:
- return "r10_usr";
- case dwarf_r11_usr:
- return "r11_usr";
- case dwarf_r12_usr:
- return "r12_usr";
- case dwarf_r13_usr:
- return "r13_usr";
- case dwarf_r14_usr:
- return "r14_usr";
- case dwarf_r8_fiq:
- return "r8_fiq";
- case dwarf_r9_fiq:
- return "r9_fiq";
- case dwarf_r10_fiq:
- return "r10_fiq";
- case dwarf_r11_fiq:
- return "r11_fiq";
- case dwarf_r12_fiq:
- return "r12_fiq";
- case dwarf_r13_fiq:
- return "r13_fiq";
- case dwarf_r14_fiq:
- return "r14_fiq";
- case dwarf_r13_irq:
- return "r13_irq";
- case dwarf_r14_irq:
- return "r14_irq";
- case dwarf_r13_abt:
- return "r13_abt";
- case dwarf_r14_abt:
- return "r14_abt";
- case dwarf_r13_und:
- return "r13_und";
- case dwarf_r14_und:
- return "r14_und";
- case dwarf_r13_svc:
- return "r13_svc";
- case dwarf_r14_svc:
- return "r14_svc";
-
- // Intel wireless MMX control register in co-processor 0 - 7
- case dwarf_wC0:
- return "wC0";
- case dwarf_wC1:
- return "wC1";
- case dwarf_wC2:
- return "wC2";
- case dwarf_wC3:
- return "wC3";
- case dwarf_wC4:
- return "wC4";
- case dwarf_wC5:
- return "wC5";
- case dwarf_wC6:
- return "wC6";
- case dwarf_wC7:
- return "wC7";
-
- // VFP-v3/Neon
- case dwarf_d0:
- return "d0";
- case dwarf_d1:
- return "d1";
- case dwarf_d2:
- return "d2";
- case dwarf_d3:
- return "d3";
- case dwarf_d4:
- return "d4";
- case dwarf_d5:
- return "d5";
- case dwarf_d6:
- return "d6";
- case dwarf_d7:
- return "d7";
- case dwarf_d8:
- return "d8";
- case dwarf_d9:
- return "d9";
- case dwarf_d10:
- return "d10";
- case dwarf_d11:
- return "d11";
- case dwarf_d12:
- return "d12";
- case dwarf_d13:
- return "d13";
- case dwarf_d14:
- return "d14";
- case dwarf_d15:
- return "d15";
- case dwarf_d16:
- return "d16";
- case dwarf_d17:
- return "d17";
- case dwarf_d18:
- return "d18";
- case dwarf_d19:
- return "d19";
- case dwarf_d20:
- return "d20";
- case dwarf_d21:
- return "d21";
- case dwarf_d22:
- return "d22";
- case dwarf_d23:
- return "d23";
- case dwarf_d24:
- return "d24";
- case dwarf_d25:
- return "d25";
- case dwarf_d26:
- return "d26";
- case dwarf_d27:
- return "d27";
- case dwarf_d28:
- return "d28";
- case dwarf_d29:
- return "d29";
- case dwarf_d30:
- return "d30";
- case dwarf_d31:
- return "d31";
-
- // NEON 128-bit vector registers (overlays the d registers)
- case dwarf_q0:
- return "q0";
- case dwarf_q1:
- return "q1";
- case dwarf_q2:
- return "q2";
- case dwarf_q3:
- return "q3";
- case dwarf_q4:
- return "q4";
- case dwarf_q5:
- return "q5";
- case dwarf_q6:
- return "q6";
- case dwarf_q7:
- return "q7";
- case dwarf_q8:
- return "q8";
- case dwarf_q9:
- return "q9";
- case dwarf_q10:
- return "q10";
- case dwarf_q11:
- return "q11";
- case dwarf_q12:
- return "q12";
- case dwarf_q13:
- return "q13";
- case dwarf_q14:
- return "q14";
- case dwarf_q15:
- return "q15";
- }
- return nullptr;
-}
-
static bool GetARMDWARFRegisterInfo(unsigned reg_num, RegisterInfo ®_info) {
::memset(®_info, 0, sizeof(RegisterInfo));
::memset(reg_info.kinds, LLDB_INVALID_REGNUM, sizeof(reg_info.kinds));
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Wed Mar 1 18:05:25 2017
@@ -600,14 +600,12 @@ protected:
}
iterator->second->Describe(
nullptr,
- [objc_runtime, &std_out](const char *name,
- const char *type) -> bool {
+ [&std_out](const char *name, const char *type) -> bool {
std_out.Printf(" instance method name = %s type = %s\n",
name, type);
return false;
},
- [objc_runtime, &std_out](const char *name,
- const char *type) -> bool {
+ [&std_out](const char *name, const char *type) -> bool {
std_out.Printf(" class method name = %s type = %s\n", name,
type);
return false;
Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Wed Mar 1 18:05:25 2017
@@ -333,7 +333,7 @@ Error PlatformAndroid::DownloadSymbolFil
// Create file remover for the temporary directory created on the device
std::unique_ptr<std::string, std::function<void(std::string *)>>
- tmpdir_remover(&tmpdir, [this, &adb](std::string *s) {
+ tmpdir_remover(&tmpdir, [&adb](std::string *s) {
StreamString command;
command.Printf("rm -rf %s", s->c_str());
Error error = adb.Shell(command.GetData(), seconds(5), nullptr);
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp Wed Mar 1 18:05:25 2017
@@ -83,8 +83,8 @@ GDBRemoteCommunicationServerPlatform::GD
&GDBRemoteCommunicationServerPlatform::Handle_jSignalsInfo);
RegisterPacketHandler(StringExtractorGDBRemote::eServerPacketType_interrupt,
- [this](StringExtractorGDBRemote packet, Error &error,
- bool &interrupt, bool &quit) {
+ [](StringExtractorGDBRemote packet, Error &error,
+ bool &interrupt, bool &quit) {
error.SetErrorString("interrupt received");
interrupt = true;
return PacketResult::Success;
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed Mar 1 18:05:25 2017
@@ -4147,8 +4147,7 @@ bool ParseRegisters(XMLNode feature_node
reg_node.ForEachAttribute([&target_info, &gdb_group, &gdb_type,
®_name, &alt_name, &set_name, &value_regs,
&invalidate_regs, &encoding_set, &format_set,
- ®_info, &cur_reg_num, ®_offset,
- &dwarf_opcode_bytes](
+ ®_info, ®_offset, &dwarf_opcode_bytes](
const llvm::StringRef &name,
const llvm::StringRef &value) -> bool {
if (name == "name") {
@@ -4310,7 +4309,7 @@ bool ProcessGDBRemote::GetGDBServerRegis
XMLNode target_node = xml_document.GetRootElement("target");
if (target_node) {
XMLNode feature_node;
- target_node.ForEachChildElement([&target_info, this, &feature_node](
+ target_node.ForEachChildElement([&target_info, &feature_node](
const XMLNode &node) -> bool {
llvm::StringRef name = node.GetName();
if (name == "architecture") {
@@ -4436,8 +4435,8 @@ Error ProcessGDBRemote::GetLoadedModuleL
LoadedModuleInfoList::LoadedModuleInfo module;
library.ForEachAttribute(
- [log, &module](const llvm::StringRef &name,
- const llvm::StringRef &value) -> bool {
+ [&module](const llvm::StringRef &name,
+ const llvm::StringRef &value) -> bool {
if (name == "name")
module.set_name(value.str());
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Mar 1 18:05:25 2017
@@ -1937,7 +1937,7 @@ void SymbolFileDWARF::Index() {
std::vector<NameToDIE> namespace_index(num_compile_units);
std::vector<bool> clear_cu_dies(num_compile_units, false);
- auto parser_fn = [this, debug_info, &function_basename_index,
+ auto parser_fn = [debug_info, &function_basename_index,
&function_fullname_index, &function_method_index,
&function_selector_index, &objc_class_selectors_index,
&global_index, &type_index,
@@ -1953,7 +1953,7 @@ void SymbolFileDWARF::Index() {
return cu_idx;
};
- auto extract_fn = [this, debug_info, num_compile_units](uint32_t cu_idx) {
+ auto extract_fn = [debug_info](uint32_t cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu) {
// dwarf_cu->ExtractDIEsIfNeeded(false) will return zero if the
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Mar 1 18:05:25 2017
@@ -1956,8 +1956,8 @@ size_t Process::RemoveBreakpointOpcodesF
if (m_breakpoint_site_list.FindInRange(bp_addr, bp_addr + size,
bp_sites_in_range)) {
- bp_sites_in_range.ForEach([bp_addr, size, buf, &bytes_removed](
- BreakpointSite *bp_site) -> void {
+ bp_sites_in_range.ForEach([bp_addr, size,
+ buf](BreakpointSite *bp_site) -> void {
if (bp_site->GetType() == BreakpointSite::eSoftware) {
addr_t intersect_addr;
size_t intersect_size;
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Mar 1 18:05:25 2017
@@ -427,7 +427,7 @@ VariableList *StackFrame::GetVariableLis
m_variable_list_sp.reset(new VariableList());
frame_block->AppendBlockVariables(can_create, get_child_variables,
stop_if_child_block_is_inlined_function,
- [this](Variable *v) { return true; },
+ [](Variable *v) { return true; },
m_variable_list_sp.get());
}
}
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Mar 1 18:05:25 2017
@@ -2173,7 +2173,7 @@ lldb::ExpressionVariableSP
Target::GetPersistentVariable(const ConstString &name) {
lldb::ExpressionVariableSP variable_sp;
m_scratch_type_system_map.ForEach(
- [this, name, &variable_sp](TypeSystem *type_system) -> bool {
+ [name, &variable_sp](TypeSystem *type_system) -> bool {
if (PersistentExpressionState *persistent_state =
type_system->GetPersistentExpressionState()) {
variable_sp = persistent_state->GetVariable(name);
@@ -2190,7 +2190,7 @@ lldb::addr_t Target::GetPersistentSymbol
lldb::addr_t address = LLDB_INVALID_ADDRESS;
m_scratch_type_system_map.ForEach(
- [this, name, &address](TypeSystem *type_system) -> bool {
+ [name, &address](TypeSystem *type_system) -> bool {
if (PersistentExpressionState *persistent_state =
type_system->GetPersistentExpressionState()) {
address = persistent_state->LookupSymbol(name);
Modified: lldb/trunk/source/Utility/VASprintf.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/VASprintf.cpp?rev=296717&r1=296716&r2=296717&view=diff
==============================================================================
--- lldb/trunk/source/Utility/VASprintf.cpp (original)
+++ lldb/trunk/source/Utility/VASprintf.cpp Wed Mar 1 18:05:25 2017
@@ -31,7 +31,7 @@ bool lldb_private::VASprintf(llvm::Small
goto finish;
}
- if (length >= buf.size()) {
+ if (size_t(length) >= buf.size()) {
// The error formatted string didn't fit into our buffer, resize it
// to the exact needed size, and retry
buf.resize(length + 1);
@@ -41,7 +41,7 @@ bool lldb_private::VASprintf(llvm::Small
result = false;
goto finish;
}
- assert(length < buf.size());
+ assert(size_t(length) < buf.size());
}
buf.resize(length);
More information about the lldb-commits
mailing list