diff options
author | Kai Nacke <kai.peter.nacke@ibm.com> | 2024-04-01 14:20:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 14:20:41 -0400 |
commit | 6634c3e9377abf88c08bb065fb55aa15cda4c248 (patch) | |
tree | c49fa3a168791414a9360289460d6ef98f8bd95f | |
parent | 5ff2773d4e606ac57750f1fc2aa4dc49b8dbede1 (diff) | |
download | llvm-6634c3e9377abf88c08bb065fb55aa15cda4c248.zip llvm-6634c3e9377abf88c08bb065fb55aa15cda4c248.tar.gz llvm-6634c3e9377abf88c08bb065fb55aa15cda4c248.tar.bz2 |
[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.
-rw-r--r-- | llvm/lib/Object/GOFFObjectFile.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Object/GOFFObjectFile.cpp b/llvm/lib/Object/GOFFObjectFile.cpp index 76a1355..d3dfd5d 100644 --- a/llvm/lib/Object/GOFFObjectFile.cpp +++ b/llvm/lib/Object/GOFFObjectFile.cpp @@ -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. |