[llvm-commits] TableGen: De-nest if's and fix revealed bug.

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Sep 17 11:04:24 PDT 2012


On Sep 15, 2012, at 2:28 PM, Sean Silva <silvas at purdue.edu> wrote:

> I was reading through TableGen's Record.cpp and found a nasty overly nested `if` situation in resolveTypes. It looks like this:
> 
> if (!T1->typeIsConvertibleTo(T2)) {
>   if (!T2->typeIsConvertibleTo(T1)) {
>     // ...
>     // Big long piece of code
>     // ...
>   }
>   return T2;
> }
> return T1;
> 
> <de-nest-ifs.patch>

Looks good!

Thanks,
/jakob




More information about the llvm-commits mailing list