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

Chris Lattner clattner at apple.com
Thu Dec 16 20:53:46 PST 2010


On Dec 16, 2010, at 7:39 AM, Nicolas Kaiser wrote:

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

CC'ing Sean,

-Chris

> 
> 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);
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list