[llvm-commits] [llvm] r151687 - in /llvm/trunk: include/llvm/MC/ include/llvm/Support/ lib/MC/MCDisassembler/ lib/Support/ lib/Target/ARM/Disassembler/ lib/Target/MBlaze/Disassembler/ lib/Target/X86/Disassembler/ tools/llvm-mc/ tools/llvm-objdump/
Derek Schuff
dschuff at google.com
Tue Feb 28 17:09:06 PST 2012
Author: dschuff
Date: Tue Feb 28 19:09:06 2012
New Revision: 151687
URL: http://llvm.org/viewvc/llvm-project?rev=151687&view=rev
Log:
Make MemoryObject accessor members const again
Modified:
llvm/trunk/include/llvm/MC/MCDisassembler.h
llvm/trunk/include/llvm/Support/MemoryObject.h
llvm/trunk/include/llvm/Support/StreamableMemoryObject.h
llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
llvm/trunk/lib/MC/MCDisassembler/EDDisassembler.cpp
llvm/trunk/lib/Support/MemoryObject.cpp
llvm/trunk/lib/Support/StreamableMemoryObject.cpp
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp
llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h
llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h
llvm/trunk/tools/llvm-mc/Disassembler.cpp
llvm/trunk/tools/llvm-objdump/MCFunction.cpp
llvm/trunk/tools/llvm-objdump/MCFunction.h
llvm/trunk/tools/llvm-objdump/llvm-objdump.h
Modified: llvm/trunk/include/llvm/MC/MCDisassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDisassembler.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCDisassembler.h (original)
+++ llvm/trunk/include/llvm/MC/MCDisassembler.h Tue Feb 28 19:09:06 2012
@@ -79,7 +79,7 @@
/// MCDisassembler::Fail if the instruction was invalid.
virtual DecodeStatus getInstruction(MCInst& instr,
uint64_t& size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const = 0;
Modified: llvm/trunk/include/llvm/Support/MemoryObject.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryObject.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MemoryObject.h (original)
+++ llvm/trunk/include/llvm/Support/MemoryObject.h Tue Feb 28 19:09:06 2012
@@ -23,27 +23,27 @@
public:
/// Destructor - Override as necessary.
virtual ~MemoryObject();
-
+
/// getBase - Returns the lowest valid address in the region.
///
/// @result - The lowest valid address.
virtual uint64_t getBase() const = 0;
-
+
/// getExtent - Returns the size of the region in bytes. (The region is
- /// contiguous, so the highest valid address of the region
+ /// contiguous, so the highest valid address of the region
/// is getBase() + getExtent() - 1).
///
/// @result - The size of the region.
- virtual uint64_t getExtent() = 0;
-
+ virtual uint64_t getExtent() const = 0;
+
/// readByte - Tries to read a single byte from the region.
///
/// @param address - The address of the byte, in the same space as getBase().
/// @param ptr - A pointer to a byte to be filled in. Must be non-NULL.
/// @result - 0 if successful; -1 if not. Failure may be due to a
/// bounds violation or an implementation-specific error.
- virtual int readByte(uint64_t address, uint8_t* ptr) = 0;
-
+ virtual int readByte(uint64_t address, uint8_t* ptr) const = 0;
+
/// readBytes - Tries to read a contiguous range of bytes from the
/// region, up to the end of the region.
/// You should override this function if there is a quicker
@@ -61,10 +61,9 @@
virtual int readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied);
+ uint64_t* copied) const;
};
}
#endif
-
Modified: llvm/trunk/include/llvm/Support/StreamableMemoryObject.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StreamableMemoryObject.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/StreamableMemoryObject.h (original)
+++ llvm/trunk/include/llvm/Support/StreamableMemoryObject.h Tue Feb 28 19:09:06 2012
@@ -45,7 +45,7 @@
/// May block until all bytes in the stream have been read
///
/// @result - The size of the region.
- virtual uint64_t getExtent() = 0;
+ virtual uint64_t getExtent() const = 0;
/// readByte - Tries to read a single byte from the region.
/// May block until (address - base) bytes have been read
@@ -53,7 +53,7 @@
/// @param ptr - A pointer to a byte to be filled in. Must be non-NULL.
/// @result - 0 if successful; -1 if not. Failure may be due to a
/// bounds violation or an implementation-specific error.
- virtual int readByte(uint64_t address, uint8_t* ptr) = 0;
+ virtual int readByte(uint64_t address, uint8_t* ptr) const = 0;
/// readBytes - Tries to read a contiguous range of bytes from the
/// region, up to the end of the region.
@@ -74,7 +74,7 @@
virtual int readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied) = 0;
+ uint64_t* copied) const = 0;
/// getPointer - Ensures that the requested data is in memory, and returns
/// A pointer to it. More efficient than using readBytes if the
@@ -83,21 +83,21 @@
/// @param address - address of the byte, in the same space as getBase()
/// @param size - amount of data that must be available on return
/// @result - valid pointer to the requested data
- virtual const uint8_t *getPointer(uint64_t address, uint64_t size) = 0;
+ virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const = 0;
/// isValidAddress - Returns true if the address is within the object
/// (i.e. between base and base + extent - 1 inclusive)
/// May block until (address - base) bytes have been read
/// @param address - address of the byte, in the same space as getBase()
/// @result - true if the address may be read with readByte()
- virtual bool isValidAddress(uint64_t address) = 0;
+ virtual bool isValidAddress(uint64_t address) const = 0;
/// isObjectEnd - Returns true if the address is one past the end of the
/// object (i.e. if it is equal to base + extent)
/// May block until (address - base) bytes have been read
/// @param address - address of the byte, in the same space as getBase()
/// @result - true if the address is equal to base + extent
- virtual bool isObjectEnd(uint64_t address) = 0;
+ virtual bool isObjectEnd(uint64_t address) const = 0;
};
/// StreamingMemoryObject - interface to data which is actually streamed from
@@ -108,13 +108,13 @@
public:
StreamingMemoryObject(DataStreamer *streamer);
virtual uint64_t getBase() const { return 0; }
- virtual uint64_t getExtent();
- virtual int readByte(uint64_t address, uint8_t* ptr);
+ virtual uint64_t getExtent() const;
+ virtual int readByte(uint64_t address, uint8_t* ptr) const;
virtual int readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied);
- virtual const uint8_t *getPointer(uint64_t address, uint64_t size) {
+ uint64_t* copied) const ;
+ virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const {
// This could be fixed by ensuring the bytes are fetched and making a copy,
// requiring that the bitcode size be known, or otherwise ensuring that
// the memory doesn't go away/get reallocated, but it's
@@ -122,8 +122,8 @@
assert(0 && "getPointer in streaming memory objects not allowed");
return NULL;
}
- virtual bool isValidAddress(uint64_t address);
- virtual bool isObjectEnd(uint64_t address);
+ virtual bool isValidAddress(uint64_t address) const;
+ virtual bool isObjectEnd(uint64_t address) const;
/// Drop s bytes from the front of the stream, pushing the positions of the
/// remaining bytes down by s. This is used to skip past the bitcode header,
@@ -138,19 +138,19 @@
private:
const static uint32_t kChunkSize = 4096 * 4;
- std::vector<unsigned char> Bytes;
+ mutable std::vector<unsigned char> Bytes;
OwningPtr<DataStreamer> Streamer;
- size_t BytesRead; // Bytes read from stream
+ mutable size_t BytesRead; // Bytes read from stream
size_t BytesSkipped;// Bytes skipped at start of stream (e.g. wrapper/header)
- size_t ObjectSize; // 0 if unknown, set if wrapper was seen or EOF reached
- bool EOFReached;
+ mutable size_t ObjectSize; // 0 if unknown, set if wrapper seen or EOF reached
+ mutable bool EOFReached;
// Fetch enough bytes such that Pos can be read or EOF is reached
// (i.e. BytesRead > Pos). Return true if Pos can be read.
// Unlike most of the functions in BitcodeReader, returns true on success.
// Most of the requests will be small, but we fetch at kChunkSize bytes
// at a time to avoid making too many potentially expensive GetBytes calls
- bool fetchToPos(size_t Pos) {
+ bool fetchToPos(size_t Pos) const {
if (EOFReached) return Pos < ObjectSize;
while (Pos >= BytesRead) {
Bytes.resize(BytesRead + BytesSkipped + kChunkSize);
Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp Tue Feb 28 19:09:06 2012
@@ -113,9 +113,9 @@
Bytes(bytes), Size(size), BasePC(basePC) {}
uint64_t getBase() const { return BasePC; }
- uint64_t getExtent() { return Size; }
+ uint64_t getExtent() const { return Size; }
- int readByte(uint64_t Addr, uint8_t *Byte) {
+ int readByte(uint64_t Addr, uint8_t *Byte) const {
if (Addr - BasePC >= Size)
return -1;
*Byte = Bytes[Addr - BasePC];
Modified: llvm/trunk/lib/MC/MCDisassembler/EDDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/EDDisassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/EDDisassembler.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/EDDisassembler.cpp Tue Feb 28 19:09:06 2012
@@ -199,8 +199,8 @@
void *arg) : Callback(callback), Arg(arg) { }
~EDMemoryObject() { }
uint64_t getBase() const { return 0x0; }
- uint64_t getExtent() { return (uint64_t)-1; }
- int readByte(uint64_t address, uint8_t *ptr) {
+ uint64_t getExtent() const { return (uint64_t)-1; }
+ int readByte(uint64_t address, uint8_t *ptr) const {
if (!Callback)
return -1;
Modified: llvm/trunk/lib/Support/MemoryObject.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryObject.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryObject.cpp (original)
+++ llvm/trunk/lib/Support/MemoryObject.cpp Tue Feb 28 19:09:06 2012
@@ -16,7 +16,7 @@
int MemoryObject::readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied) {
+ uint64_t* copied) const {
uint64_t current = address;
uint64_t limit = getBase() + getExtent();
Modified: llvm/trunk/lib/Support/StreamableMemoryObject.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StreamableMemoryObject.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Support/StreamableMemoryObject.cpp (original)
+++ llvm/trunk/lib/Support/StreamableMemoryObject.cpp Tue Feb 28 19:09:06 2012
@@ -24,15 +24,17 @@
}
virtual uint64_t getBase() const { return 0; }
- virtual uint64_t getExtent() { return LastChar - FirstChar; }
- virtual int readByte(uint64_t address, uint8_t* ptr);
+ virtual uint64_t getExtent() const { return LastChar - FirstChar; }
+ virtual int readByte(uint64_t address, uint8_t* ptr) const;
virtual int readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied);
- virtual const uint8_t *getPointer(uint64_t address, uint64_t size);
- virtual bool isValidAddress(uint64_t address) {return validAddress(address);}
- virtual bool isObjectEnd(uint64_t address) {return objectEnd(address);}
+ uint64_t* copied) const;
+ virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const;
+ virtual bool isValidAddress(uint64_t address) const {
+ return validAddress(address);
+ }
+ virtual bool isObjectEnd(uint64_t address) const {return objectEnd(address);}
private:
const uint8_t* const FirstChar;
@@ -40,10 +42,10 @@
// These are implemented as inline functions here to avoid multiple virtual
// calls per public function
- bool validAddress(uint64_t address) {
+ bool validAddress(uint64_t address) const {
return static_cast<ptrdiff_t>(address) < LastChar - FirstChar;
}
- bool objectEnd(uint64_t address) {
+ bool objectEnd(uint64_t address) const {
return static_cast<ptrdiff_t>(address) == LastChar - FirstChar;
}
@@ -51,7 +53,7 @@
void operator=(const RawMemoryObject&); // DO NOT IMPLEMENT
};
-int RawMemoryObject::readByte(uint64_t address, uint8_t* ptr) {
+int RawMemoryObject::readByte(uint64_t address, uint8_t* ptr) const {
if (!validAddress(address)) return -1;
*ptr = *((uint8_t *)(uintptr_t)(address + FirstChar));
return 0;
@@ -60,14 +62,15 @@
int RawMemoryObject::readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied) {
+ uint64_t* copied) const {
if (!validAddress(address) || !validAddress(address + size - 1)) return -1;
memcpy(buf, (uint8_t *)(uintptr_t)(address + FirstChar), size);
if (copied) *copied = size;
return size;
}
-const uint8_t *RawMemoryObject::getPointer(uint64_t address, uint64_t size) {
+const uint8_t *RawMemoryObject::getPointer(uint64_t address,
+ uint64_t size) const {
return FirstChar + address;
}
} // anonymous namespace
@@ -75,18 +78,18 @@
namespace llvm {
// If the bitcode has a header, then its size is known, and we don't have to
// block until we actually want to read it.
-bool StreamingMemoryObject::isValidAddress(uint64_t address) {
+bool StreamingMemoryObject::isValidAddress(uint64_t address) const {
if (ObjectSize && address < ObjectSize) return true;
return fetchToPos(address);
}
-bool StreamingMemoryObject::isObjectEnd(uint64_t address) {
+bool StreamingMemoryObject::isObjectEnd(uint64_t address) const {
if (ObjectSize) return address == ObjectSize;
fetchToPos(address);
return address == ObjectSize && address != 0;
}
-uint64_t StreamingMemoryObject::getExtent() {
+uint64_t StreamingMemoryObject::getExtent() const {
if (ObjectSize) return ObjectSize;
size_t pos = BytesRead + kChunkSize;
// keep fetching until we run out of bytes
@@ -94,7 +97,7 @@
return ObjectSize;
}
-int StreamingMemoryObject::readByte(uint64_t address, uint8_t* ptr) {
+int StreamingMemoryObject::readByte(uint64_t address, uint8_t* ptr) const {
if (!fetchToPos(address)) return -1;
*ptr = Bytes[address + BytesSkipped];
return 0;
@@ -103,7 +106,7 @@
int StreamingMemoryObject::readBytes(uint64_t address,
uint64_t size,
uint8_t* buf,
- uint64_t* copied) {
+ uint64_t* copied) const {
if (!fetchToPos(address + size - 1)) return -1;
memcpy(buf, &Bytes[address + BytesSkipped], size);
if (copied) *copied = size;
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Tue Feb 28 19:09:06 2012
@@ -46,7 +46,7 @@
/// getInstruction - See MCDisassembler.
DecodeStatus getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const;
@@ -71,7 +71,7 @@
/// getInstruction - See MCDisassembler.
DecodeStatus getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const;
@@ -341,7 +341,7 @@
}
DecodeStatus ARMDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
- MemoryObject &Region,
+ const MemoryObject &Region,
uint64_t Address,
raw_ostream &os,
raw_ostream &cs) const {
@@ -689,7 +689,7 @@
}
DecodeStatus ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
- MemoryObject &Region,
+ const MemoryObject &Region,
uint64_t Address,
raw_ostream &os,
raw_ostream &cs) const {
Modified: llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp Tue Feb 28 19:09:06 2012
@@ -502,7 +502,7 @@
MCDisassembler::DecodeStatus MBlazeDisassembler::getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const {
Modified: llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h (original)
+++ llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h Tue Feb 28 19:09:06 2012
@@ -40,7 +40,7 @@
/// getInstruction - See MCDisassembler.
MCDisassembler::DecodeStatus getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const;
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp Tue Feb 28 19:09:06 2012
@@ -121,7 +121,7 @@
MCDisassembler::DecodeStatus
X86GenericDisassembler::getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const {
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h Tue Feb 28 19:09:06 2012
@@ -117,7 +117,7 @@
/// getInstruction - See MCDisassembler.
DecodeStatus getInstruction(MCInst &instr,
uint64_t &size,
- MemoryObject ®ion,
+ const MemoryObject ®ion,
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const;
Modified: llvm/trunk/tools/llvm-mc/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Disassembler.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/Disassembler.cpp (original)
+++ llvm/trunk/tools/llvm-mc/Disassembler.cpp Tue Feb 28 19:09:06 2012
@@ -42,9 +42,9 @@
VectorMemoryObject(const ByteArrayTy &bytes) : Bytes(bytes) {}
uint64_t getBase() const { return 0; }
- uint64_t getExtent() { return Bytes.size(); }
+ uint64_t getExtent() const { return Bytes.size(); }
- int readByte(uint64_t Addr, uint8_t *Byte) {
+ int readByte(uint64_t Addr, uint8_t *Byte) const {
if (Addr >= getExtent())
return -1;
*Byte = Bytes[Addr].first;
@@ -365,4 +365,3 @@
return 0;
}
-
Modified: llvm/trunk/tools/llvm-objdump/MCFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MCFunction.cpp?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MCFunction.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MCFunction.cpp Tue Feb 28 19:09:06 2012
@@ -28,7 +28,7 @@
MCFunction
MCFunction::createFunctionFromMC(StringRef Name, const MCDisassembler *DisAsm,
- MemoryObject &Region, uint64_t Start,
+ const MemoryObject &Region, uint64_t Start,
uint64_t End, const MCInstrAnalysis *Ana,
raw_ostream &DebugOut,
SmallVectorImpl<uint64_t> &Calls) {
Modified: llvm/trunk/tools/llvm-objdump/MCFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MCFunction.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MCFunction.h (original)
+++ llvm/trunk/tools/llvm-objdump/MCFunction.h Tue Feb 28 19:09:06 2012
@@ -79,7 +79,7 @@
// Create an MCFunction from a region of binary machine code.
static MCFunction
createFunctionFromMC(StringRef Name, const MCDisassembler *DisAsm,
- MemoryObject &Region, uint64_t Start, uint64_t End,
+ const MemoryObject &Region, uint64_t Start, uint64_t End,
const MCInstrAnalysis *Ana, raw_ostream &DebugOut,
SmallVectorImpl<uint64_t> &Calls);
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.h?rev=151687&r1=151686&r2=151687&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.h (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.h Tue Feb 28 19:09:06 2012
@@ -31,9 +31,9 @@
StringRefMemoryObject(StringRef bytes) : Bytes(bytes) {}
uint64_t getBase() const { return 0; }
- uint64_t getExtent() { return Bytes.size(); }
+ uint64_t getExtent() const { return Bytes.size(); }
- int readByte(uint64_t Addr, uint8_t *Byte) {
+ int readByte(uint64_t Addr, uint8_t *Byte) const {
if (Addr >= getExtent())
return -1;
*Byte = Bytes[Addr];
More information about the llvm-commits
mailing list