Start block isn't a special case anymore (and now get the old node nr).
[libfirm] / ir / be / belive.c
index c223029..267a4f5 100644 (file)
@@ -43,8 +43,8 @@
 
 #include "beutil.h"
 #include "belive_t.h"
-#include "beirg_t.h"
-#include "besched_t.h"
+#include "beirg.h"
+#include "besched.h"
 #include "bemodule.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
@@ -113,10 +113,10 @@ static inline unsigned _be_liveness_bsearch(struct _be_lv_info_t *arr, unsigned
        int lo       = 0;
        int hi       = n;
 
-       if(n == 0)
+       if (n == 0)
                return 0;
 
-       while(lo < hi) {
+       do {
                int md          = lo + ((hi - lo) >> 1);
                unsigned md_idx = payload[md].u.node.idx;
 
@@ -131,12 +131,12 @@ static inline unsigned _be_liveness_bsearch(struct _be_lv_info_t *arr, unsigned
                }
 
                res = lo;
-       }
+       } while (lo < hi);
 
 #ifdef LV_INTESIVE_CHECKS
        {
                unsigned i;
-               for(i = res; i < n; ++i)
+               for (i = res; i < n; ++i)
                        assert(payload[i].u.node.idx >= idx);
 
                for(i = 0; i < res; ++i)