[llvm-commits] [llvm] r93960 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Bill Wendling wendling at apple.com
Tue Jan 19 17:19:23 PST 2010


On Jan 19, 2010, at 4:59 PM, David Greene wrote:

> Author: greened
> Date: Tue Jan 19 18:59:23 2010
> New Revision: 93960
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=93960&view=rev
> Log:
> 
> Add some asserts to check SelectionDAG problems earlier.
> 
>         // Update P's outstanding operand count.
>         P->setNodeId(Degree);
>       }
>     }
> +    if (I == SortedPos) {
> +      allnodes_iterator J = I;
> +      SDNode *S = ++J;
> +      dbgs() << "Offending node:\n";
> +      S->dumprFull();
> +      assert(I != SortedPos && "Overran sorted position");
> +    }
>   }
> 
Hi David,

What's the intent of this bit of code? If you intend it to assert always, then please use "0" instead of "I != SortedPos". Note that in "Release" mode, this code will emit whatever "S->dumprFull()" spits out and then continue on its merry way. It seems to me as if this should either be #ifdef'ed by NDEBUG or that all but the assert should be inside of a DEBUG() macro.

-bw





More information about the llvm-commits mailing list