Skip to content

Commit

Permalink
Since the DisasmMemoryObject only operates on const data, it now only…
Browse files Browse the repository at this point in the history
… accepts a const data pointer. This silences a -Wcast-qual warning.

llvm-svn: 218454
  • Loading branch information
AaronBallman committed Sep 25, 2014
1 parent 31f7125 commit 8cb2cae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/tools/llvm-objdump/MachODump.cpp
Expand Up @@ -555,11 +555,11 @@ const char *SymbolizerSymbolLookUp(void *DisInfo, uint64_t ReferenceValue,
// generally not linked at address zero.
//
class DisasmMemoryObject : public MemoryObject {
uint8_t *Bytes;
const uint8_t *Bytes;
uint64_t Size;
uint64_t BasePC;
public:
DisasmMemoryObject(uint8_t *bytes, uint64_t size, uint64_t basePC) :
DisasmMemoryObject(const uint8_t *bytes, uint64_t size, uint64_t basePC) :
Bytes(bytes), Size(size), BasePC(basePC) {}

uint64_t getBase() const override { return BasePC; }
Expand Down Expand Up @@ -788,7 +788,7 @@ static void DisassembleInputMachO2(StringRef Filename,
Sections[SectIdx].getContents(Bytes);
uint64_t SectAddress = 0;
Sections[SectIdx].getAddress(SectAddress);
DisasmMemoryObject MemoryObject((uint8_t *)Bytes.data(), Bytes.size(),
DisasmMemoryObject MemoryObject((const uint8_t *)Bytes.data(), Bytes.size(),
SectAddress);
bool symbolTableWorked = false;

Expand Down

0 comments on commit 8cb2cae

Please sign in to comment.