Skip to content

Commit 344df8d

Browse files
Roman Levensteinfacebook-github-bot
Roman Levenstein
authored andcommitted
Support -debug-glow-only even in release builds
Reviewed By: junhanh Differential Revision: D54523800
1 parent 9ecc93a commit 344df8d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

include/glow/Support/Debug.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
namespace glow {
2020

21-
#ifndef NDEBUG
21+
#if !defined(NDEBUG) && !defined(DISABLE_DEBUG_GLOW)
2222

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

2626
/// Macro to perform debug actions when TYPE is activated.
2727
#define DEBUG_GLOW_WITH_TYPE(TYPE, X) \
2828
do { \
29-
if (glow::DebugFlag || glow::isCurrentDebugType(TYPE)) { \
29+
if (glow::DebugFlag || glow::isGlowCurrentDebugType(TYPE)) { \
3030
X; \
3131
} \
3232
} while (false)

lib/Optimizer/IROptimizer/IROptimizer.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,10 @@ class LiveIntervalsInstructionNumbering {
160160
};
161161
} // namespace
162162

163-
#ifndef NDEBUG
164163
llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Interval &I) {
165164
os << I.str();
166165
return os;
167166
}
168-
#endif
169167

170168
/// Set of intervals for a single memory buffer. If there is only one write into
171169
/// a memory buffer, it would contain a single interval. If there are multiple

lib/Support/Debug.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ namespace glow {
4141
/// Exported boolean set by -debug-glow option.
4242
bool DebugFlag = false;
4343

44-
#ifndef NDEBUG
45-
bool isCurrentDebugType(const char *type) {
44+
#if !defined(NDEBUG) && !defined(DISABLE_DEBUG_GLOW)
45+
bool isGlowCurrentDebugType(const char *type) {
4646
return std::find(DebugGlowOnly.begin(), DebugGlowOnly.end(), type) !=
4747
DebugGlowOnly.end();
4848
}

0 commit comments

Comments
 (0)