[LLVMdev] [patch] remove redundant code in X86DisassemblerDecoder.c
Jim Grosbach
grosbach at apple.com
Thu Sep 12 09:24:23 PDT 2013
LGTM.
On Sep 11, 2013, at 10:44 PM, Jun Koi <junkoi2004 at gmail.com> wrote:
> there is an if-else code in X86DisassemblerDecoder.c that does exactly the same thing on both paths. so this patch removes the redundant path.
>
> thanks,
> Jun
>
>
> diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
> index 20e61da..3932ea1 100644
> --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
> +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
> @@ -550,11 +550,6 @@ static int readPrefixes(struct InternalInstruction* insn) {
> 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