mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-22 09:25:44 +00:00
[llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -194,19 +194,6 @@ static const Target *getTarget(const ObjectFile *Obj = nullptr) {
|
||||
return TheTarget;
|
||||
}
|
||||
|
||||
void llvm::DumpBytes(ArrayRef<uint8_t> bytes) {
|
||||
static const char hex_rep[] = "0123456789abcdef";
|
||||
SmallString<64> output;
|
||||
|
||||
for (char i: bytes) {
|
||||
output.push_back(hex_rep[(i & 0xF0) >> 4]);
|
||||
output.push_back(hex_rep[i & 0xF]);
|
||||
output.push_back(' ');
|
||||
}
|
||||
|
||||
outs() << output.c_str();
|
||||
}
|
||||
|
||||
bool llvm::RelocAddressLess(RelocationRef a, RelocationRef b) {
|
||||
uint64_t a_addr, b_addr;
|
||||
if (error(a.getOffset(a_addr))) return false;
|
||||
@@ -399,7 +386,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
|
||||
outs() << format("%8" PRIx64 ":", SectionAddr + Index);
|
||||
if (!NoShowRawInsn) {
|
||||
outs() << "\t";
|
||||
DumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, Size));
|
||||
dumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, Size), outs());
|
||||
}
|
||||
IP->printInst(&Inst, outs(), "", *STI);
|
||||
outs() << CommentStream.str();
|
||||
|
Reference in New Issue
Block a user