[PATCH] D14922: [ELF/AArch64] Factor out overflow check into a separate function.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 11:40:56 PST 2015


On 23 November 2015 at 13:04, Rui Ueyama via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> ruiu added a comment.
>
> I'm not in favor of this change, and I wouldn't do that. The previous code was super clear that it errors if isInt check fails. Now you have to take a look at the definition of checkAArch64OutOfRange function. You saved one line per a function call, but it doesn't seem like a good tradeoff from code readability point of view.

How about something like

checkIsInt<N>(Val, Msg);

It should be almost as compact as this change and easy to read.

Cheers,
Rafael


More information about the llvm-commits mailing list