From 37ed9c199ca639565f6ce88105f9e39e898d82d0 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 1 Dec 2014 14:51:49 -0800 Subject: Update aosp/master LLVM for rebase to r222494. Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d --- .../PowerPC/Disassembler/PPCDisassembler.cpp | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp') diff --git a/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp b/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp index a2305a9..5251b60 100644 --- a/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp +++ b/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp @@ -12,7 +12,6 @@ #include "llvm/MC/MCFixedLenDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/Support/MemoryObject.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; @@ -28,13 +27,10 @@ public: : MCDisassembler(STI, Ctx) {} virtual ~PPCDisassembler() {} - // Override MCDisassembler. - virtual DecodeStatus getInstruction(MCInst &instr, - uint64_t &size, - const MemoryObject ®ion, - uint64_t address, - raw_ostream &vStream, - raw_ostream &cStream) const override; + DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, + ArrayRef Bytes, uint64_t Address, + raw_ostream &VStream, + raw_ostream &CStream) const override; }; } // end anonymous namespace @@ -325,23 +321,19 @@ static DecodeStatus decodeCRBitMOperand(MCInst &Inst, uint64_t Imm, #include "PPCGenDisassemblerTables.inc" DecodeStatus PPCDisassembler::getInstruction(MCInst &MI, uint64_t &Size, - const MemoryObject &Region, - uint64_t Address, - raw_ostream &os, - raw_ostream &cs) const { + ArrayRef Bytes, + uint64_t Address, raw_ostream &OS, + raw_ostream &CS) const { // Get the four bytes of the instruction. - uint8_t Bytes[4]; Size = 4; - if (Region.readBytes(Address, Size, Bytes) == -1) { + if (Bytes.size() < 4) { Size = 0; return MCDisassembler::Fail; } // The instruction is big-endian encoded. - uint32_t Inst = (Bytes[0] << 24) | - (Bytes[1] << 16) | - (Bytes[2] << 8) | - (Bytes[3] << 0); + uint32_t Inst = + (Bytes[0] << 24) | (Bytes[1] << 16) | (Bytes[2] << 8) | (Bytes[3] << 0); return decodeInstruction(DecoderTable32, MI, Inst, Address, this, STI); } -- cgit v1.1