Skip to content

Commit ec81084

Browse files
committed
Incorporate review feedback
1 parent 7e1e98f commit ec81084

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CIR/CodeGen/CIRGenBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
3030
/// Note: This is different from what is returned by
3131
/// mlir::Builder::getStringAttr() which is an mlir::StringAttr.
3232
mlir::Attribute getString(llvm::StringRef str, mlir::Type eltTy,
33-
unsigned size) {
34-
unsigned finalSize = size ? size : str.size();
33+
std::optional<size_t> size) {
34+
size_t finalSize = size ? *size : str.size();
3535

3636
size_t lastNonZeroPos = str.find_last_not_of('\0');
3737
// If the string is full of null bytes, emit a #cir.zero rather than
@@ -41,7 +41,7 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
4141
return cir::ZeroAttr::get(arrayTy);
4242
}
4343
// We emit trailing zeros only if there are multiple trailing zeros.
44-
int trailingZerosNum = 0;
44+
size_t trailingZerosNum = 0;
4545
if (finalSize > lastNonZeroPos + 2)
4646
trailingZerosNum = finalSize - lastNonZeroPos - 1;
4747
auto truncatedArrayTy =

0 commit comments

Comments
 (0)