diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/MC/MCInst.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/MC/MCInst.cpp')
| -rw-r--r-- | gnu/llvm/lib/MC/MCInst.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gnu/llvm/lib/MC/MCInst.cpp b/gnu/llvm/lib/MC/MCInst.cpp index f9b71caaf91..64f111fc711 100644 --- a/gnu/llvm/lib/MC/MCInst.cpp +++ b/gnu/llvm/lib/MC/MCInst.cpp @@ -72,11 +72,17 @@ void MCInst::print(raw_ostream &OS) const { void MCInst::dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer, StringRef Separator) const { + StringRef InstName = Printer ? Printer->getOpcodeName(getOpcode()) : ""; + dump_pretty(OS, InstName, Separator); +} + +void MCInst::dump_pretty(raw_ostream &OS, StringRef Name, + StringRef Separator) const { OS << "<MCInst #" << getOpcode(); - // Show the instruction opcode name if we have access to a printer. - if (Printer) - OS << ' ' << Printer->getOpcodeName(getOpcode()); + // Show the instruction opcode name if we have it. + if (!Name.empty()) + OS << ' ' << Name; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { OS << Separator; |
