summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-01-11 15:06:02 -0800
committerFangrui Song <maskray@google.com>2020-01-11 15:43:26 -0800
commit1e8ce7492e91aa6db269334d12187c7ae854dccb (patch)
treeac03314f1d730c66584f5ab7a783c5fd685259f5 /llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
parent6fdd6a7b3f696972edc244488f59532d05136a27 (diff)
downloadbcm5719-llvm-1e8ce7492e91aa6db269334d12187c7ae854dccb.tar.gz
bcm5719-llvm-1e8ce7492e91aa6db269334d12187c7ae854dccb.zip
[X86][Disassembler] Optimize argument passing and immediate reading
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h')
-rw-r--r--llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
index a1e036ca7ba..df4085edb81 100644
--- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
+++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
@@ -19,6 +19,9 @@
#include "llvm/Support/X86DisassemblerDecoderCommon.h"
namespace llvm {
+
+class MCInstrInfo;
+
namespace X86Disassembler {
// Accessor functions for various fields of an Intel instruction
@@ -530,7 +533,7 @@ struct InstructionSpecifier {
/// The x86 internal instruction, which is produced by the decoder.
struct InternalInstruction {
// Opaque value passed to the reader
- const void* readerArg;
+ llvm::ArrayRef<uint8_t> bytes;
// The address of the next byte to read via the reader
uint64_t readerCursor;
@@ -652,19 +655,8 @@ struct InternalInstruction {
/// Decode one instruction and store the decoding results in
/// a buffer provided by the consumer.
-/// \param insn The buffer to store the instruction in. Allocated by the
-/// consumer.
-/// \param readerArg An argument to pass to the reader for storing context
-/// specific to the consumer. May be NULL.
-/// \param startLoc The address (in the reader's address space) of the first
-/// byte in the instruction.
-/// \param mode The mode (16-bit, 32-bit, 64-bit) to decode in.
/// \return Nonzero if there was an error during decode, 0 otherwise.
-int decodeInstruction(InternalInstruction *insn,
- const void *readerArg,
- const void *miiArg,
- uint64_t startLoc,
- DisassemblerMode mode);
+int decodeInstruction(InternalInstruction *insn, const MCInstrInfo *mii);
/// Print a message to debugs()
/// \param file The name of the file printing the debug message.
OpenPOWER on IntegriCloud