[Lldb-commits] [lldb] r283018 - Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)
Mehdi Amini via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 30 23:46:34 PDT 2016
Author: mehdi_amini
Date: Sat Oct 1 01:46:33 2016
New Revision: 283018
URL: http://llvm.org/viewvc/llvm-project?rev=283018&view=rev
Log:
Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)
Modified:
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=283018&r1=283017&r2=283018&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Sat Oct 1 01:46:33 2016
@@ -1101,7 +1101,7 @@ bool EmulateInstructionMIPS::EvaluateIns
* mc_insn.getOpcode() returns decoded opcode. However to make use
* of llvm::Mips::<insn> we would need "MipsGenInstrInfo.inc".
*/
- const char *op_name = m_insn_info->getName(mc_insn.getOpcode());
+ const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
if (op_name == NULL)
return false;
@@ -1373,7 +1373,7 @@ bool EmulateInstructionMIPS::Emulate_SUB
bool success = false;
uint64_t result;
uint8_t src, dst, rt;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
dst = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
src = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
@@ -1834,7 +1834,7 @@ bool EmulateInstructionMIPS::Emulate_BXX
bool success = false;
uint32_t rs, rt;
int32_t offset, pc, target = 0, rs_val, rt_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
rt = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
@@ -1886,7 +1886,7 @@ bool EmulateInstructionMIPS::Emulate_BXX
bool success = false;
uint32_t rs, rt;
int32_t offset, pc, target = 0, rs_val, rt_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
uint32_t current_inst_size = m_insn_info->get(insn.getOpcode()).getSize();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
@@ -1969,7 +1969,7 @@ bool EmulateInstructionMIPS::Emulate_Bco
uint32_t rs;
int32_t offset, pc, target = 0;
int32_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -2038,7 +2038,7 @@ bool EmulateInstructionMIPS::Emulate_Bco
uint32_t rs;
int32_t offset, pc, target = 0;
int32_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -2088,7 +2088,7 @@ bool EmulateInstructionMIPS::Emulate_BXX
uint32_t rs;
int32_t offset, pc, target = 0;
int32_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -2144,7 +2144,7 @@ bool EmulateInstructionMIPS::Emulate_BXX
uint32_t rs;
int32_t offset, pc, target = 0;
int32_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
uint32_t current_inst_size = m_insn_info->get(insn.getOpcode()).getSize();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
@@ -2236,7 +2236,7 @@ bool EmulateInstructionMIPS::Emulate_Bra
bool success = false;
int32_t target = 0;
uint32_t current_inst_size = m_insn_info->get(insn.getOpcode()).getSize();
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
bool update_ra = false;
uint32_t ra_offset = 0;
@@ -2336,7 +2336,7 @@ bool EmulateInstructionMIPS::Emulate_Bra
bool EmulateInstructionMIPS::Emulate_JALRx16_MM(llvm::MCInst &insn) {
bool success = false;
uint32_t ra_offset = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
uint32_t rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
@@ -2375,7 +2375,7 @@ bool EmulateInstructionMIPS::Emulate_JAL
bool EmulateInstructionMIPS::Emulate_JALx(llvm::MCInst &insn) {
bool success = false;
uint32_t offset = 0, target = 0, pc = 0, ra_offset = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
/*
* JALS target
@@ -2735,7 +2735,7 @@ bool EmulateInstructionMIPS::Emulate_FP_
bool success = false;
uint32_t cc, fcsr;
int32_t pc, offset, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
cc = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -2860,7 +2860,7 @@ bool EmulateInstructionMIPS::Emulate_3D_
bool success = false;
uint32_t cc, fcsr;
int32_t pc, offset, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
cc = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=283018&r1=283017&r2=283018&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Sat Oct 1 01:46:33 2016
@@ -953,7 +953,7 @@ bool EmulateInstructionMIPS64::EvaluateI
* mc_insn.getOpcode() returns decoded opcode. However to make use
* of llvm::Mips::<insn> we would need "MipsGenInstrInfo.inc".
*/
- const char *op_name = m_insn_info->getName(mc_insn.getOpcode());
+ const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
if (op_name == NULL)
return false;
@@ -1239,7 +1239,7 @@ bool EmulateInstructionMIPS64::Emulate_D
bool success = false;
uint64_t result;
uint8_t src, dst, rt;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
dst = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
src = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
@@ -1318,7 +1318,7 @@ bool EmulateInstructionMIPS64::Emulate_B
bool success = false;
uint32_t rs, rt;
int64_t offset, pc, rs_val, rt_val, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
rt = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
@@ -1371,7 +1371,7 @@ bool EmulateInstructionMIPS64::Emulate_B
uint32_t rs;
int64_t offset, pc, target = 0;
int64_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -1481,7 +1481,7 @@ bool EmulateInstructionMIPS64::Emulate_B
bool success = false;
uint32_t rs;
int64_t offset, pc, rs_val, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -1549,7 +1549,7 @@ bool EmulateInstructionMIPS64::Emulate_B
bool success = false;
uint32_t rs;
int64_t offset, pc, rs_val, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
@@ -1636,7 +1636,7 @@ bool EmulateInstructionMIPS64::Emulate_B
bool success = false;
uint32_t rs, rt;
int64_t offset, pc, rs_val, rt_val, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
uint32_t current_inst_size = m_insn_info->get(insn.getOpcode()).getSize();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
@@ -1719,7 +1719,7 @@ bool EmulateInstructionMIPS64::Emulate_B
uint32_t rs;
int64_t offset, pc, target = 0;
int64_t rs_val;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
uint32_t current_inst_size = m_insn_info->get(insn.getOpcode()).getSize();
rs = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
@@ -1970,7 +1970,7 @@ bool EmulateInstructionMIPS64::Emulate_F
bool success = false;
uint32_t cc, fcsr;
int64_t pc, offset, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
/*
* BC1F cc, offset
@@ -2104,7 +2104,7 @@ bool EmulateInstructionMIPS64::Emulate_3
bool success = false;
uint32_t cc, fcsr;
int64_t pc, offset, target = 0;
- const char *op_name = m_insn_info->getName(insn.getOpcode());
+ const char *op_name = m_insn_info->getName(insn.getOpcode()).data();
cc = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
offset = insn.getOperand(1).getImm();
More information about the lldb-commits
mailing list