[PPL-devel] [GIT] ppl/ppl(master): Reordered so as to allow compilability with -DPPL_PROFILE_ADD_WEIGHT=1.
Roberto Bagnara
bagnara at cs.unipr.it
Fri Apr 6 12:46:11 CEST 2012
Module: ppl/ppl
Branch: master
Commit: fb4ff186479c5cd0a16838439b7b9743c9c10292
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=fb4ff186479c5cd0a16838439b7b9743c9c10292
Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date: Fri Apr 6 12:13:14 2012 +0200
Reordered so as to allow compilability with -DPPL_PROFILE_ADD_WEIGHT=1.
---
src/globals.defs.hh | 94 ++++++++++++++++++++++++++-------------------------
1 files changed, 48 insertions(+), 46 deletions(-)
diff --git a/src/globals.defs.hh b/src/globals.defs.hh
index c0b3733..53815ef 100644
--- a/src/globals.defs.hh
+++ b/src/globals.defs.hh
@@ -32,9 +32,6 @@ site: http://bugseng.com/products/ppl/ . */
#include <exception>
#include <gmpxx.h>
-#if defined(NDEBUG) && PPL_PROFILE_ADD_WEIGHT
-#include "Weight_Profiler.defs.hh"
-#endif
namespace Parma_Polyhedra_Library {
@@ -143,49 +140,6 @@ extern unsigned int in_assert;
} // namespace Implementation
#endif
-#ifndef PPL_PROFILE_ADD_WEIGHT
-#define PPL_PROFILE_ADD_WEIGHT 0
-#endif
-
-#if defined(NDEBUG)
-#if PPL_PROFILE_ADD_WEIGHT
-#define WEIGHT_BEGIN() Weight_Profiler::begin()
-#define WEIGHT_ADD(delta) \
- do { \
- static Weight_Profiler wp__(__FILE__, __LINE__, delta); \
- wp__.end(); \
- } while (false)
-#define WEIGHT_ADD_MUL(delta, factor) \
- do { \
- static Weight_Profiler wp__(__FILE__, __LINE__, delta); \
- wp__.end(factor); \
- } while (false)
-#else
-#define WEIGHT_BEGIN() \
- do { \
- } while (false)
-#define WEIGHT_ADD(delta) \
- do { \
- Weightwatch_Traits::weight += (delta); \
- } while (false)
-#define WEIGHT_ADD_MUL(delta, factor) \
- do { \
- Weightwatch_Traits::weight += (delta)*(factor); \
- } while (false)
-#endif
-#else
-#define WEIGHT_BEGIN()
-#define WEIGHT_ADD(delta) \
- do { \
- if (Implementation::in_assert == 0) \
- Weightwatch_Traits::weight += delta; \
- } while (false)
-#define WEIGHT_ADD_MUL(delta, factor) \
- do { \
- if (Implementation::in_assert == 0) \
- Weightwatch_Traits::weight += delta * factor; \
- } while (false)
-#endif
//! User objects the PPL can throw.
/*! \ingroup PPL_CXX_interface
@@ -515,6 +469,54 @@ least_significant_one_mask(dimension_type i);
#define PPL_USE_SPARSE_MATRIX 1
#endif
+#ifndef PPL_PROFILE_ADD_WEIGHT
+#define PPL_PROFILE_ADD_WEIGHT 0
+#endif
+
+#if defined(NDEBUG) && PPL_PROFILE_ADD_WEIGHT
+#include "Weight_Profiler.defs.hh"
+#endif
+
+#if defined(NDEBUG)
+#if PPL_PROFILE_ADD_WEIGHT
+#define WEIGHT_BEGIN() Weight_Profiler::begin()
+#define WEIGHT_ADD(delta) \
+ do { \
+ static Weight_Profiler wp__(__FILE__, __LINE__, delta); \
+ wp__.end(); \
+ } while (false)
+#define WEIGHT_ADD_MUL(delta, factor) \
+ do { \
+ static Weight_Profiler wp__(__FILE__, __LINE__, delta); \
+ wp__.end(factor); \
+ } while (false)
+#else
+#define WEIGHT_BEGIN() \
+ do { \
+ } while (false)
+#define WEIGHT_ADD(delta) \
+ do { \
+ Weightwatch_Traits::weight += (delta); \
+ } while (false)
+#define WEIGHT_ADD_MUL(delta, factor) \
+ do { \
+ Weightwatch_Traits::weight += (delta)*(factor); \
+ } while (false)
+#endif
+#else
+#define WEIGHT_BEGIN()
+#define WEIGHT_ADD(delta) \
+ do { \
+ if (Implementation::in_assert == 0) \
+ Weightwatch_Traits::weight += delta; \
+ } while (false)
+#define WEIGHT_ADD_MUL(delta, factor) \
+ do { \
+ if (Implementation::in_assert == 0) \
+ Weightwatch_Traits::weight += delta * factor; \
+ } while (false)
+#endif
+
#include "globals.inlines.hh"
#endif // !defined(PPL_globals_defs_hh)
More information about the PPL-devel
mailing list