diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2010-12-22 23:15:24 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2010-12-22 23:15:24 -0600 |
commit | 58fa2857e123a44b1633628b898847773153c047 (patch) | |
tree | abf6318d961c8bcb31d7a0f5c4aa9bbb4a0db0ed /src/mem/ruby/common | |
parent | 2c0e80f96bee8c2ad48cd3fb7a18af149bfe76bc (diff) | |
download | gem5-58fa2857e123a44b1633628b898847773153c047.tar.xz |
This patch removes the WARN_* and ERROR_* from src/mem/ruby/common/Debug.hh file. These statements have been replaced with warn(), panic() and fatal() defined in src/base/misc.hh
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r-- | src/mem/ruby/common/Debug.hh | 65 | ||||
-rw-r--r-- | src/mem/ruby/common/NetDest.cc | 4 | ||||
-rw-r--r-- | src/mem/ruby/common/Set.cc | 7 |
3 files changed, 5 insertions, 71 deletions
diff --git a/src/mem/ruby/common/Debug.hh b/src/mem/ruby/common/Debug.hh index 8a2b75de3..4183aca4d 100644 --- a/src/mem/ruby/common/Debug.hh +++ b/src/mem/ruby/common/Debug.hh @@ -119,9 +119,6 @@ operator<<(std::ostream& out, const Debug& obj) return out; } -const bool ERROR_MESSAGE_FLAG = true; -const bool WARNING_MESSAGE_FLAG = true; - #undef assert #define assert(EXPR) ASSERT(EXPR) #undef ASSERT @@ -161,67 +158,5 @@ const bool WARNING_MESSAGE_FLAG = true; #endif // NDEBUG -#define ERROR_MSG(MESSAGE) do { \ - using namespace std; \ - if (ERROR_MESSAGE_FLAG) { \ - cerr << "Fatal Error: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << (MESSAGE) << endl << flush; \ - (* debug_cout_ptr) << "Fatal Error: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << (MESSAGE) << endl << flush; \ - abort(); \ - } \ -} while(0) - -#define WARN_MSG(MESSAGE) do { \ - using namespace std; \ - if (WARNING_MESSAGE_FLAG) { \ - cerr << "Warning: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << (MESSAGE) << endl << flush; \ - (* debug_cout_ptr) << "Warning: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << (MESSAGE) << endl << flush; \ - } \ -} while (0) - -#define WARN_EXPR(EXPR) do { \ - using namespace std; \ - if (WARNING_MESSAGE_FLAG) { \ - cerr << "Warning: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << #EXPR << " is " \ - << (EXPR) << endl << flush; \ - (* debug_cout_ptr) << "Warning: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": " \ - << #EXPR << " is " \ - << (EXPR) << endl << flush; \ - } \ -} while (0) - -#define ERROR_OUT( rest... ) do { \ - using namespace std; \ - if (ERROR_MESSAGE_FLAG) { \ - cout << "error: in fn " \ - << __PRETTY_FUNCTION__ << " in " \ - << __FILE__ << ":" \ - << __LINE__ << ": "; \ - g_debug_ptr->debugMsg(rest); \ - } \ -} while (0) - #endif // __MEM_RUBY_COMMON_DEBUG_HH__ diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc index dbe02b0ca..657df08b2 100644 --- a/src/mem/ruby/common/NetDest.cc +++ b/src/mem/ruby/common/NetDest.cc @@ -151,7 +151,7 @@ NetDest::smallestElement() const } } } - ERROR_MSG("No smallest element of an empty set."); + panic("No smallest element of an empty set."); } MachineID @@ -165,7 +165,7 @@ NetDest::smallestElement(MachineType machine) const } } - ERROR_MSG("No smallest element of given MachineType."); + panic("No smallest element of given MachineType."); } // Returns true iff all bits are set diff --git a/src/mem/ruby/common/Set.cc b/src/mem/ruby/common/Set.cc index c946fec16..e747f5159 100644 --- a/src/mem/ruby/common/Set.cc +++ b/src/mem/ruby/common/Set.cc @@ -29,6 +29,7 @@ // modified (rewritten) 05/20/05 by Dan Gibson to accomimdate FASTER // >32 bit set sizes +#include "base/misc.hh" #include "mem/ruby/common/Set.hh" #include "mem/ruby/system/System.hh" @@ -199,13 +200,11 @@ Set::smallestElement() const x = x >> 1; } - ERROR_MSG("No smallest element of an empty set."); + panic("No smallest element of an empty set."); } } - ERROR_MSG("No smallest element of an empty set."); - - return 0; + panic("No smallest element of an empty set."); } /* |