add a new MCInstPrinter::getOpcodeName interface, when it is
implemented, llvm-mc --show-inst now uses it to print the
instruction opcode as well as the number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95929 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86MCCodeEmitter.cpp b/lib/Target/X86/X86MCCodeEmitter.cpp
index 15510e8..5d745d2 100644
--- a/lib/Target/X86/X86MCCodeEmitter.cpp
+++ b/lib/Target/X86/X86MCCodeEmitter.cpp
@@ -282,11 +282,11 @@
/// size, and 3) use of X86-64 extended registers.
static unsigned DetermineREXPrefix(const MCInst &MI, unsigned TSFlags,
const TargetInstrDesc &Desc) {
- unsigned REX = 0;
+ // Pseudo instructions shouldn't get here.
+ assert((TSFlags & X86II::FormMask) != X86II::Pseudo &&
+ "Can't encode pseudo instrs");
- // Pseudo instructions do not need REX prefix byte.
- if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
- return 0;
+ unsigned REX = 0;
if (TSFlags & X86II::REX_W)
REX |= 1 << 3;