[Objdump] DumpBytes of uint8_t from ArrayRef<uint8_t> instead of char from StringRef. Removing reinterpret_casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Colin LeMahieu
2015-03-18 19:27:31 +00:00
parent bd23c08119
commit db4d401364
3 changed files with 13 additions and 19 deletions

View File

@ -194,7 +194,7 @@ static const Target *getTarget(const ObjectFile *Obj = nullptr) {
return TheTarget;
}
void llvm::DumpBytes(StringRef bytes) {
void llvm::DumpBytes(ArrayRef<uint8_t> bytes) {
static const char hex_rep[] = "0123456789abcdef";
SmallString<64> output;
@ -399,8 +399,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
outs() << format("%8" PRIx64 ":", SectionAddr + Index);
if (!NoShowRawInsn) {
outs() << "\t";
DumpBytes(StringRef(
reinterpret_cast<const char *>(Bytes.data()) + Index, Size));
DumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, Size));
}
IP->printInst(&Inst, outs(), "");
outs() << CommentStream.str();