Skip to content

Commit 6634c3e

Browse files
authored
[GOFF] Wrap debug output with LLVM_DEBUG (#87252)
The content of a GOFF record is always dumped if NDEBUG is not defined, which produces rather confusing output. This changes wrap the dumping code in LLVM_DEBUG, so the dump is only done when debug output of this module is requested.
1 parent 5ff2773 commit 6634c3e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Object/GOFFObjectFile.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,13 @@ GOFFObjectFile::GOFFObjectFile(MemoryBufferRef Object, Error &Err)
104104
PrevContinuationBits = I[1] & 0x03;
105105
continue;
106106
}
107-
108-
#ifndef NDEBUG
109-
for (size_t J = 0; J < GOFF::RecordLength; ++J) {
107+
LLVM_DEBUG(for (size_t J = 0; J < GOFF::RecordLength; ++J) {
110108
const uint8_t *P = I + J;
111109
if (J % 8 == 0)
112110
dbgs() << " ";
113-
114111
dbgs() << format("%02hhX", *P);
115-
}
116-
#endif
112+
});
113+
117114
switch (RecordType) {
118115
case GOFF::RT_ESD: {
119116
// Save ESD record.

0 commit comments

Comments
 (0)