[llvm-commits] [llvm] r80358 - in /llvm/trunk/lib/Transforms/Instrumentation: MaximumSpanningTree.cpp MaximumSpanningTree.h

Chris Lattner clattner at apple.com
Sat Aug 29 17:26:29 PDT 2009


On Aug 28, 2009, at 4:28 AM, Andreas Neustifter wrote:

> Author: astifter
> Date: Fri Aug 28 06:28:24 2009
> New Revision: 80358
>
> URL: http://llvm.org/viewvc/llvm-project?rev=80358&view=rev
> Log:
> Preparation for Optimal Edge Profiling:
> This implements the maximum spanning tree algorithm on CFGs  
> according to
> weights given by the ProfileEstimator. This is then used to  
> implement Optimal
> Edge Profiling.

Hi Andreas,

> +  // compare two weighted edges
> +  struct VISIBILITY_HIDDEN EdgeWeightCompare {
> +    bool operator()(const ProfileInfo::EdgeWeight X,
> +                    const ProfileInfo::EdgeWeight Y) const {
> +      if (X.second > Y.second) return true;
> +      if (X.second < Y.second) return false;
> +#ifndef NDEBUG

Why does this predicate depend on whether assertions are enabled or  
not?  That sounds like a potential source of really insidious bugs.

-Chris




More information about the llvm-commits mailing list