summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2015-05-28 18:39:50 +0000
committerColin LeMahieu <colinl@codeaurora.org>2015-05-28 18:39:50 +0000
commit2048ea4056ee4f7893931fd2b2ebfcc62f6058b8 (patch)
tree0c08ba29e59fc3913f7bb4ac808ea784e61bf398 /llvm/lib
parentdd04352558d71b5f0eabb35fc9053036599cc9df (diff)
downloadbcm5719-llvm-2048ea4056ee4f7893931fd2b2ebfcc62f6058b8.tar.gz
bcm5719-llvm-2048ea4056ee4f7893931fd2b2ebfcc62f6058b8.zip
[llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
llvm-svn: 238453
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCInstPrinter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCInstPrinter.cpp b/llvm/lib/MC/MCInstPrinter.cpp
index 0dc31215ce9..23afe805484 100644
--- a/llvm/lib/MC/MCInstPrinter.cpp
+++ b/llvm/lib/MC/MCInstPrinter.cpp
@@ -16,6 +16,15 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+void llvm::dumpBytes(ArrayRef<uint8_t> bytes, raw_ostream &OS) {
+ static const char hex_rep[] = "0123456789abcdef";
+ for (char i: bytes) {
+ OS << hex_rep[(i & 0xF0) >> 4];
+ OS << hex_rep[i & 0xF];
+ OS << ' ';
+ }
+}
+
MCInstPrinter::~MCInstPrinter() {
}
OpenPOWER on IntegriCloud