[MLIR] Adopt LDBG() debug macro in BytecodeWriter.cpp (NFC) (#154642)
This commit is contained in:
parent
908eebcb93
commit
62b29d9f76
@ -19,6 +19,7 @@
|
||||
#include "llvm/ADT/MapVector.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/DebugLog.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <optional>
|
||||
@ -150,8 +151,7 @@ public:
|
||||
|
||||
/// Backpatch a byte in the result buffer at the given offset.
|
||||
void patchByte(uint64_t offset, uint8_t value, StringLiteral desc) {
|
||||
LLVM_DEBUG(llvm::dbgs() << "patchByte(" << offset << ',' << uint64_t(value)
|
||||
<< ")\t" << desc << '\n');
|
||||
LDBG() << "patchByte(" << offset << ',' << uint64_t(value) << ")\t" << desc;
|
||||
assert(offset < size() && offset >= prevResultSize &&
|
||||
"cannot patch previously emitted data");
|
||||
currentResult[offset - prevResultSize] = value;
|
||||
@ -160,8 +160,7 @@ public:
|
||||
/// Emit the provided blob of data, which is owned by the caller and is
|
||||
/// guaranteed to not die before the end of the bytecode process.
|
||||
void emitOwnedBlob(ArrayRef<uint8_t> data, StringLiteral desc) {
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
<< "emitOwnedBlob(" << data.size() << "b)\t" << desc << '\n');
|
||||
LDBG() << "emitOwnedBlob(" << data.size() << "b)\t" << desc;
|
||||
// Push the current buffer before adding the provided data.
|
||||
appendResult(std::move(currentResult));
|
||||
appendOwnedResult(data);
|
||||
@ -209,15 +208,13 @@ public:
|
||||
/// Emit a single byte.
|
||||
template <typename T>
|
||||
void emitByte(T byte, StringLiteral desc) {
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
<< "emitByte(" << uint64_t(byte) << ")\t" << desc << '\n');
|
||||
LDBG() << "emitByte(" << uint64_t(byte) << ")\t" << desc;
|
||||
currentResult.push_back(static_cast<uint8_t>(byte));
|
||||
}
|
||||
|
||||
/// Emit a range of bytes.
|
||||
void emitBytes(ArrayRef<uint8_t> bytes, StringLiteral desc) {
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
<< "emitBytes(" << bytes.size() << "b)\t" << desc << '\n');
|
||||
LDBG() << "emitBytes(" << bytes.size() << "b)\t" << desc;
|
||||
llvm::append_range(currentResult, bytes);
|
||||
}
|
||||
|
||||
@ -229,7 +226,7 @@ public:
|
||||
/// additional bytes, provide the value of the integer encoded in
|
||||
/// little-endian order.
|
||||
void emitVarInt(uint64_t value, StringLiteral desc) {
|
||||
LLVM_DEBUG(llvm::dbgs() << "emitVarInt(" << value << ")\t" << desc << '\n');
|
||||
LDBG() << "emitVarInt(" << value << ")\t" << desc;
|
||||
|
||||
// In the most common case, the value can be represented in a single byte.
|
||||
// Given how hot this case is, explicitly handle that here.
|
||||
|
Loading…
x
Reference in New Issue
Block a user