[LLVMdev] x86 disassembler: if-statement with redundant branch

Nicolas Kaiser nikai at nikai.net
Thu Dec 16 07:39:58 PST 2010


Hi there!

In the x86 disassembler I noticed an if-statement with a
duplicated branch. Are these intended to be identical?

Best regards,
Nicolas Kaiser
--
diff -ur llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
--- llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c	2010-05-06 22:59:00.000000000 +0200
+++ llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c	2010-12-16 16:24:28.583323293 +0100
@@ -412,11 +412,6 @@
       insn->addressSize        = (hasAdSize ? 4 : 8);
       insn->displacementSize   = 4;
       insn->immediateSize      = 4;
-    } else if (insn->rexPrefix) {
-      insn->registerSize       = (hasOpSize ? 2 : 4);
-      insn->addressSize        = (hasAdSize ? 4 : 8);
-      insn->displacementSize   = (hasOpSize ? 2 : 4);
-      insn->immediateSize      = (hasOpSize ? 2 : 4);
     } else {
       insn->registerSize       = (hasOpSize ? 2 : 4);
       insn->addressSize        = (hasAdSize ? 4 : 8);




More information about the llvm-dev mailing list