Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/include/lldb/Core/Disassembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ class Instruction {

virtual bool IsLoad() = 0;

virtual bool IsBarrier() = 0;

virtual bool IsAuthenticated() = 0;

bool CanSetBreakpoint();
Expand Down Expand Up @@ -367,6 +369,8 @@ class PseudoInstruction : public Instruction {

bool IsLoad() override;

bool IsBarrier() override;

bool IsAuthenticated() override;

void CalculateMnemonicOperandsAndComment(
Expand Down
5 changes: 5 additions & 0 deletions lldb/source/Core/Disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,11 @@ bool PseudoInstruction::DoesBranch() {
return false;
}

bool PseudoInstruction::IsBarrier() {
// This is NOT a valid question for a pseudo instruction.
return false;
}

bool PseudoInstruction::HasDelaySlot() {
// This is NOT a valid question for a pseudo instruction.
return false;
Expand Down
13 changes: 13 additions & 0 deletions lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class DisassemblerLLVMC::MCDisasmInstance {
bool HasDelaySlot(llvm::MCInst &mc_inst) const;
bool IsCall(llvm::MCInst &mc_inst) const;
bool IsLoad(llvm::MCInst &mc_inst) const;
bool IsBarrier(llvm::MCInst &mc_inst) const;
bool IsAuthenticated(llvm::MCInst &mc_inst) const;

private:
Expand Down Expand Up @@ -436,6 +437,11 @@ class InstructionLLVMC : public lldb_private::Instruction {
return m_is_load;
}

bool IsBarrier() override {
VisitInstruction();
return m_is_barrier;
}

bool IsAuthenticated() override {
VisitInstruction();
return m_is_authenticated;
Expand Down Expand Up @@ -1195,6 +1201,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
bool m_is_call = false;
bool m_is_load = false;
bool m_is_authenticated = false;
bool m_is_barrier = false;

void VisitInstruction() {
if (m_has_visited_instruction)
Expand Down Expand Up @@ -1227,6 +1234,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
m_is_call = mc_disasm_ptr->IsCall(inst);
m_is_load = mc_disasm_ptr->IsLoad(inst);
m_is_authenticated = mc_disasm_ptr->IsAuthenticated(inst);
m_is_barrier = mc_disasm_ptr->IsBarrier(inst);
}

private:
Expand Down Expand Up @@ -1432,6 +1440,11 @@ bool DisassemblerLLVMC::MCDisasmInstance::IsLoad(llvm::MCInst &mc_inst) const {
return m_instr_info_up->get(mc_inst.getOpcode()).mayLoad();
}

bool DisassemblerLLVMC::MCDisasmInstance::IsBarrier(
llvm::MCInst &mc_inst) const {
return m_instr_info_up->get(mc_inst.getOpcode()).isBarrier();
}

bool DisassemblerLLVMC::MCDisasmInstance::IsAuthenticated(
llvm::MCInst &mc_inst) const {
const auto &InstrDesc = m_instr_info_up->get(mc_inst.getOpcode());
Expand Down
Loading