summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadbcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h232
1 files changed, 106 insertions, 126 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
index f2f54d39399..26bed7ee0d7 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
@@ -25,148 +25,128 @@
#include "lldb/Core/PluginManager.h"
// Opaque references to C++ Objects in LLVM's MC.
-namespace llvm
-{
- class MCContext;
- class MCInst;
- class MCInstrInfo;
- class MCRegisterInfo;
- class MCDisassembler;
- class MCInstPrinter;
- class MCAsmInfo;
- class MCSubtargetInfo;
+namespace llvm {
+class MCContext;
+class MCInst;
+class MCInstrInfo;
+class MCRegisterInfo;
+class MCDisassembler;
+class MCInstPrinter;
+class MCAsmInfo;
+class MCSubtargetInfo;
} // namespace llvm
class InstructionLLVMC;
-class DisassemblerLLVMC : public lldb_private::Disassembler
-{
- // Since we need to make two actual MC Disassemblers for ARM (ARM & THUMB), and there's a bit of goo to set up and own
- // in the MC disassembler world, I added this class to manage the actual disassemblers.
- class LLVMCDisassembler
- {
- public:
- LLVMCDisassembler (const char *triple, const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC &owner);
-
- ~LLVMCDisassembler();
-
- uint64_t GetMCInst (const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc, llvm::MCInst &mc_inst);
- void PrintMCInst (llvm::MCInst &mc_inst, std::string &inst_string, std::string &comments_string);
- void SetStyle (bool use_hex_immed, HexImmediateStyle hex_style);
- bool CanBranch (llvm::MCInst &mc_inst);
- bool HasDelaySlot (llvm::MCInst &mc_inst);
- bool IsCall (llvm::MCInst &mc_inst);
- bool IsValid()
- {
- return m_is_valid;
- }
-
- private:
- bool m_is_valid;
- std::unique_ptr<llvm::MCContext> m_context_ap;
- std::unique_ptr<llvm::MCAsmInfo> m_asm_info_ap;
- std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_ap;
- std::unique_ptr<llvm::MCInstrInfo> m_instr_info_ap;
- std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_ap;
- std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_ap;
- std::unique_ptr<llvm::MCDisassembler> m_disasm_ap;
- };
+class DisassemblerLLVMC : public lldb_private::Disassembler {
+ // Since we need to make two actual MC Disassemblers for ARM (ARM & THUMB),
+ // and there's a bit of goo to set up and own
+ // in the MC disassembler world, I added this class to manage the actual
+ // disassemblers.
+ class LLVMCDisassembler {
+ public:
+ LLVMCDisassembler(const char *triple, const char *cpu,
+ const char *features_str, unsigned flavor,
+ DisassemblerLLVMC &owner);
+
+ ~LLVMCDisassembler();
+
+ uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len,
+ lldb::addr_t pc, llvm::MCInst &mc_inst);
+ void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string,
+ std::string &comments_string);
+ void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style);
+ bool CanBranch(llvm::MCInst &mc_inst);
+ bool HasDelaySlot(llvm::MCInst &mc_inst);
+ bool IsCall(llvm::MCInst &mc_inst);
+ bool IsValid() { return m_is_valid; }
+
+ private:
+ bool m_is_valid;
+ std::unique_ptr<llvm::MCContext> m_context_ap;
+ std::unique_ptr<llvm::MCAsmInfo> m_asm_info_ap;
+ std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_ap;
+ std::unique_ptr<llvm::MCInstrInfo> m_instr_info_ap;
+ std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_ap;
+ std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_ap;
+ std::unique_ptr<llvm::MCDisassembler> m_disasm_ap;
+ };
public:
- DisassemblerLLVMC(const lldb_private::ArchSpec &arch, const char *flavor /* = NULL */);
+ DisassemblerLLVMC(const lldb_private::ArchSpec &arch,
+ const char *flavor /* = NULL */);
- ~DisassemblerLLVMC() override;
+ ~DisassemblerLLVMC() override;
- //------------------------------------------------------------------
- // Static Functions
- //------------------------------------------------------------------
- static void
- Initialize();
+ //------------------------------------------------------------------
+ // Static Functions
+ //------------------------------------------------------------------
+ static void Initialize();
- static void
- Terminate();
+ static void Terminate();
- static lldb_private::ConstString
- GetPluginNameStatic();
+ static lldb_private::ConstString GetPluginNameStatic();
- static lldb_private::Disassembler *
- CreateInstance(const lldb_private::ArchSpec &arch, const char *flavor);
+ static lldb_private::Disassembler *
+ CreateInstance(const lldb_private::ArchSpec &arch, const char *flavor);
- size_t
- DecodeInstructions(const lldb_private::Address &base_addr,
- const lldb_private::DataExtractor& data,
- lldb::offset_t data_offset,
- size_t num_instructions,
- bool append,
- bool data_from_file) override;
+ size_t DecodeInstructions(const lldb_private::Address &base_addr,
+ const lldb_private::DataExtractor &data,
+ lldb::offset_t data_offset, size_t num_instructions,
+ bool append, bool data_from_file) override;
- //------------------------------------------------------------------
- // PluginInterface protocol
- //------------------------------------------------------------------
- lldb_private::ConstString
- GetPluginName() override;
+ //------------------------------------------------------------------
+ // PluginInterface protocol
+ //------------------------------------------------------------------
+ lldb_private::ConstString GetPluginName() override;
- uint32_t
- GetPluginVersion() override;
+ uint32_t GetPluginVersion() override;
protected:
- friend class InstructionLLVMC;
-
- bool
- FlavorValidForArchSpec(const lldb_private::ArchSpec &arch, const char *flavor) override;
-
- bool
- IsValid()
- {
- return (m_disasm_ap.get() != NULL && m_disasm_ap->IsValid());
- }
-
- int OpInfo(uint64_t PC,
- uint64_t Offset,
- uint64_t Size,
- int TagType,
- void *TagBug);
-
- const char *SymbolLookup (uint64_t ReferenceValue,
- uint64_t *ReferenceType,
- uint64_t ReferencePC,
- const char **ReferenceName);
-
- static int OpInfoCallback (void *DisInfo,
- uint64_t PC,
- uint64_t Offset,
- uint64_t Size,
- int TagType,
- void *TagBug);
-
- static const char *SymbolLookupCallback(void *DisInfo,
- uint64_t ReferenceValue,
- uint64_t *ReferenceType,
- uint64_t ReferencePC,
- const char **ReferenceName);
-
- void Lock(InstructionLLVMC *inst,
- const lldb_private::ExecutionContext *exe_ctx)
- {
- m_mutex.lock();
- m_inst = inst;
- m_exe_ctx = exe_ctx;
- }
-
- void Unlock()
- {
- m_inst = NULL;
- m_exe_ctx = NULL;
- m_mutex.unlock();
- }
-
- const lldb_private::ExecutionContext *m_exe_ctx;
- InstructionLLVMC *m_inst;
- std::mutex m_mutex;
- bool m_data_from_file;
-
- std::unique_ptr<LLVMCDisassembler> m_disasm_ap;
- std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap;
+ friend class InstructionLLVMC;
+
+ bool FlavorValidForArchSpec(const lldb_private::ArchSpec &arch,
+ const char *flavor) override;
+
+ bool IsValid() {
+ return (m_disasm_ap.get() != NULL && m_disasm_ap->IsValid());
+ }
+
+ int OpInfo(uint64_t PC, uint64_t Offset, uint64_t Size, int TagType,
+ void *TagBug);
+
+ const char *SymbolLookup(uint64_t ReferenceValue, uint64_t *ReferenceType,
+ uint64_t ReferencePC, const char **ReferenceName);
+
+ static int OpInfoCallback(void *DisInfo, uint64_t PC, uint64_t Offset,
+ uint64_t Size, int TagType, void *TagBug);
+
+ static const char *SymbolLookupCallback(void *DisInfo,
+ uint64_t ReferenceValue,
+ uint64_t *ReferenceType,
+ uint64_t ReferencePC,
+ const char **ReferenceName);
+
+ void Lock(InstructionLLVMC *inst,
+ const lldb_private::ExecutionContext *exe_ctx) {
+ m_mutex.lock();
+ m_inst = inst;
+ m_exe_ctx = exe_ctx;
+ }
+
+ void Unlock() {
+ m_inst = NULL;
+ m_exe_ctx = NULL;
+ m_mutex.unlock();
+ }
+
+ const lldb_private::ExecutionContext *m_exe_ctx;
+ InstructionLLVMC *m_inst;
+ std::mutex m_mutex;
+ bool m_data_from_file;
+
+ std::unique_ptr<LLVMCDisassembler> m_disasm_ap;
+ std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap;
};
#endif // liblldb_DisassemblerLLVM_h_
OpenPOWER on IntegriCloud