Simplify control flow.
[libfirm] / ir / stat / statev.h
index 886a223..8d135df 100644 (file)
  * @brief       Statistic events.
  * @author      Sebastian Hack
  * @date        17.06.2007
- * @version     $Id$
  */
 
 #ifndef FIRM_STATEVENT_H
 #define FIRM_STATEVENT_H
 
-#if !defined(FIRM_STATISTICS) || defined(DISABLE_STATEV)
-
-#define stat_ev_do(expr)
-#define stat_ev_enabled             0
-#define stat_ev_if                  if (0)
-#define stat_ev_dbl(name, val)
-#define stat_ev_int(name, val)
-#define stat_ev(name)
-#define stat_ev_emit(name, value)
-
-#define stat_ev_cnt_decl(var)
-#define stat_ev_cnt_inc(var)
-#define stat_ev_cnt_done(name, var)
-#define stat_ev_tim_push()
-#define stat_ev_tim_pop(name)
-
-#define stat_ev_ctx_push(key)
-#define stat_ev_ctx_push_str(key, str)
-#define stat_ev_ctx_push_fmt(key, fmt, value)
-#define stat_ev_ctx_push_fobj(key, firm_object)
-#define stat_ev_ctx_pop(key)
-#define stat_ev_flush()
+#ifdef DISABLE_STATEV
+
+#define stat_ev_enabled                          0
+#define stat_ev_dbl(name, val)                   ((void)0)
+#define stat_ev_int(name, val)                   ((void)0)
+#define stat_ev(name)                            ((void)0)
+#define stat_ev_emit(name, value)                ((void)0)
+
+#define stat_ev_cnt_decl(var)                    ((void)0)
+#define stat_ev_cnt_inc(var)                     ((void)0)
+#define stat_ev_cnt_done(name, var)              ((void)0)
+#define stat_ev_tim_push()                       ((void)0)
+#define stat_ev_tim_pop(name)                    ((void)0)
+
+#define stat_ev_ctx_push(key)                    ((void)0)
+#define stat_ev_ctx_push_str(key, str)           ((void)0)
+#define stat_ev_ctx_push_fmt(key, fmt, value)    ((void)0)
+#define stat_ev_ctx_push_fobj(key, firm_object)  ((void)0)
+#define stat_ev_ctx_pop(key)                     ((void)0)
+#define stat_ev_flush()                          ((void)0)
 
 #else
 
@@ -132,9 +129,6 @@ static inline void stat_ev_tim_pop(const char *name) {
 #define stat_ev_cnt_inc(var)        do { ++stat_ev_cnt_var_ ## var; } while(0)
 #define stat_ev_cnt_done(var, name) stat_ev_emit((name), stat_ev_cnt_var_ ## var)
 
-#define stat_ev_do(expr)            (stat_ev_enabled ? ((expr), 1) : 0)
-#define stat_ev_if                  if (stat_ev_enabled)
-
 /**
  * Initialize the stat ev machinery.
  * @param filename_prefix  The prefix of the filename (.ev or .ev.gz will be appended).
@@ -151,4 +145,4 @@ void stat_ev_end(void);
 
 #endif
 
-#endif /* FIRM_STATEVENT_H */
+#endif