Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support -debug-glow-only even in release builds #6158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/glow/Support/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

namespace glow {

#ifndef NDEBUG
#if !defined(NDEBUG) && !defined(DISABLE_DEBUG_GLOW)

/// \returns true if \p type matches the activated debug type.
bool isCurrentDebugType(const char *type);
bool isGlowCurrentDebugType(const char *type);

/// Macro to perform debug actions when TYPE is activated.
#define DEBUG_GLOW_WITH_TYPE(TYPE, X) \
do { \
if (glow::DebugFlag || glow::isCurrentDebugType(TYPE)) { \
if (glow::DebugFlag || glow::isGlowCurrentDebugType(TYPE)) { \
X; \
} \
} while (false)
Expand Down
2 changes: 0 additions & 2 deletions lib/Optimizer/IROptimizer/IROptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,10 @@ class LiveIntervalsInstructionNumbering {
};
} // namespace

#ifndef NDEBUG
llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Interval &I) {
os << I.str();
return os;
}
#endif

/// Set of intervals for a single memory buffer. If there is only one write into
/// a memory buffer, it would contain a single interval. If there are multiple
Expand Down
4 changes: 2 additions & 2 deletions lib/Support/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace glow {
/// Exported boolean set by -debug-glow option.
bool DebugFlag = false;

#ifndef NDEBUG
bool isCurrentDebugType(const char *type) {
#if !defined(NDEBUG) && !defined(DISABLE_DEBUG_GLOW)
bool isGlowCurrentDebugType(const char *type) {
return std::find(DebugGlowOnly.begin(), DebugGlowOnly.end(), type) !=
DebugGlowOnly.end();
}
Expand Down
Loading