Currently there is a separate emulation function for each branch instruction, however the emulation logic is almost identical for many of these instructions.
This patch merges emulation of similar instructions into a single function (wherever possible) to remove code duplication.
Details
Details
- Reviewers
clayborg
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Hi, this introduces loads of new compiler warnings like:
lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp:1434:14: warning: variable 'target' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if (!strcasecmp (op_name, "BNE") || ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp:1447:77: note: uninitialized use occurs here if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_pc_mips, target)) ^~~~~~ lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp:1434:10: note: remove the 'if' if its condition is always true else if (!strcasecmp (op_name, "BNE") || ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp:1407:31: note: initialize the variable 'target' to silence this warning int32_t offset, pc, target, rs_val, rt_val; ^ = 0
Could you please resolve these?
Comment Actions
Hi Pavel,
Could you please confirm if http://reviews.llvm.org/rL256929 resolves the build warnings?