This is an archive of the discontinued LLVM Phabricator instance.

Move GetControlFlowKind's logic to DisassemblerLLVMC.cpp
ClosedPublic

Authored by persona0220 on Jul 21 2022, 5:55 PM.

Details

Summary

This diff move the logic of GetControlFlowKind() from Disassembler.cpp to DisassemblerLLVMC.cpp.
Here's details:

  • Actual logic of GetControlFlowKind() move to DisassemblerLLVMC.cpp, and we can check underlying architecture using DisassemblerScope there.
  • With this change, passing 'triple' to GetControlFlowKind() is no more required.

Diff Detail

Event Timeline

persona0220 created this revision.Jul 21 2022, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 5:55 PM
persona0220 requested review of this revision.Jul 21 2022, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 5:55 PM
persona0220 edited the summary of this revision. (Show Details)

Not to cache the control flow kind

wallace accepted this revision.Jul 22 2022, 8:42 AM

great! thank you. I'll land this

This revision is now accepted and ready to land.Jul 22 2022, 8:42 AM

Just one more change and good to go

lldb/include/lldb/Core/Disassembler.h
87

could add a default implementation here?

{

  return lldb::eInstructionControlFlowKindUnknown;
}

that way you won't break any other class that extends Instruction.

Add default implementation for GetControlFlowKind()