Skip to content

Commit 4ac09b3

Browse files
committed
[MLIR] Adopt LDBG() macro in BuiltinAttributes.cpp (NFC)
1 parent 5928619 commit 4ac09b3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

mlir/lib/IR/BuiltinAttributes.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "mlir/IR/Types.h"
2020
#include "llvm/ADT/APSInt.h"
2121
#include "llvm/Support/Debug.h"
22+
#include "llvm/Support/DebugLog.h"
2223
#include "llvm/Support/Endian.h"
2324
#include <optional>
2425

@@ -1119,29 +1120,24 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
11191120
auto denseEltBitWidth = getDenseElementBitWidth(type);
11201121
auto dataSize = static_cast<size_t>(dataEltSize * CHAR_BIT);
11211122
if (denseEltBitWidth != dataSize) {
1122-
LLVM_DEBUG(llvm::dbgs() << "expected dense element bit width "
1123-
<< denseEltBitWidth << " to match data size "
1124-
<< dataSize << " for type " << type << "\n");
1123+
LDBG() << "expected dense element bit width " << denseEltBitWidth
1124+
<< " to match data size " << dataSize << " for type " << type;
11251125
return false;
11261126
}
11271127

11281128
// Check that the element type is either float or integer or index.
11291129
if (!isInt) {
11301130
bool valid = llvm::isa<FloatType>(type);
11311131
if (!valid)
1132-
LLVM_DEBUG(llvm::dbgs()
1133-
<< "expected float type when isInt is false, but found "
1134-
<< type << "\n");
1132+
LDBG() << "expected float type when isInt is false, but found " << type;
11351133
return valid;
11361134
}
11371135
if (type.isIndex())
11381136
return true;
11391137

11401138
auto intType = llvm::dyn_cast<IntegerType>(type);
11411139
if (!intType) {
1142-
LLVM_DEBUG(llvm::dbgs()
1143-
<< "expected integer type when isInt is true, but found " << type
1144-
<< "\n");
1140+
LDBG() << "expected integer type when isInt is true, but found " << type;
11451141
return false;
11461142
}
11471143

@@ -1151,8 +1147,7 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
11511147

11521148
bool valid = intType.isSigned() == isSigned;
11531149
if (!valid)
1154-
LLVM_DEBUG(llvm::dbgs() << "expected signedness " << isSigned
1155-
<< " to match type " << type << "\n");
1150+
LDBG() << "expected signedness " << isSigned << " to match type " << type;
11561151
return valid;
11571152
}
11581153

0 commit comments

Comments
 (0)