Skip to content

Commit

Permalink
[GOFF] Wrap debug output with LLVM_DEBUG (#87252)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
redstar committed Apr 1, 2024
1 parent 5ff2773 commit 6634c3e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions llvm/lib/Object/GOFFObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,13 @@ GOFFObjectFile::GOFFObjectFile(MemoryBufferRef Object, Error &Err)
PrevContinuationBits = I[1] & 0x03;
continue;
}

#ifndef NDEBUG
for (size_t J = 0; J < GOFF::RecordLength; ++J) {
LLVM_DEBUG(for (size_t J = 0; J < GOFF::RecordLength; ++J) {
const uint8_t *P = I + J;
if (J % 8 == 0)
dbgs() << " ";

dbgs() << format("%02hhX", *P);
}
#endif
});

switch (RecordType) {
case GOFF::RT_ESD: {
// Save ESD record.
Expand Down

0 comments on commit 6634c3e

Please sign in to comment.