Skip to content

Commit a87d905

Browse files
committed
clang-format, use less auto
1 parent d35acb6 commit a87d905

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool ConstantAggregateBuilder::addBits(llvm::APInt bits, uint64_t offsetInBits,
188188
const ASTContext &astContext = cgm.getASTContext();
189189
const uint64_t charWidth = cgm.getASTContext().getCharWidth();
190190
mlir::Type charTy = cgm.getBuilder().getUIntNTy(charWidth);
191-
191+
192192
// Offset of where we want the first bit to go within the bits of the
193193
// current char.
194194
unsigned offsetWithinChar = offsetInBits % charWidth;
@@ -312,7 +312,7 @@ std::optional<size_t> ConstantAggregateBuilder::splitAt(CharUnits pos) {
312312

313313
size_t index = iter - elements.begin() - 1;
314314
const Element &elt = elements[index];
315-
315+
316316
// If we already have an element starting at pos, we're done.
317317
if (elt.offset == pos)
318318
return index;
@@ -336,7 +336,8 @@ bool ConstantAggregateBuilder::split(size_t index, CharUnits hint) {
336336
return false;
337337
}
338338

339-
void ConstantAggregateBuilder::condense(CharUnits offset, mlir::Type desiredTy) {
339+
void ConstantAggregateBuilder::condense(CharUnits offset,
340+
mlir::Type desiredTy) {
340341
CharUnits desiredSize = getSize(desiredTy);
341342

342343
std::optional<size_t> firstElemToReplace = splitAt(offset);
@@ -361,11 +362,11 @@ void ConstantAggregateBuilder::condense(CharUnits offset, mlir::Type desiredTy)
361362

362363
// Build a new constant from the elements in the range.
363364
SmallVector<Element> subElems(elements.begin() + first,
364-
elements.begin() + last);
365+
elements.begin() + last);
365366
mlir::Attribute replacement =
366367
buildFrom(cgm, subElems, offset, desiredSize,
367368
/*naturalLayout=*/false, desiredTy, false);
368-
369+
369370
// Replace the range with the condensed constant.
370371
Element newElt(mlir::cast<mlir::TypedAttr>(replacement), offset);
371372
replace(elements, first, last, {newElt});
@@ -526,8 +527,9 @@ bool ConstRecordBuilder::appendBytes(CharUnits fieldOffsetInChars,
526527
bool ConstRecordBuilder::appendBitField(const FieldDecl *field,
527528
uint64_t fieldOffset, cir::IntAttr ci,
528529
bool allowOverwrite) {
529-
const auto &rl = cgm.getTypes().getCIRGenRecordLayout(field->getParent());
530-
const auto &info = rl.getBitFieldInfo(field);
530+
const CIRGenRecordLayout &rl =
531+
cgm.getTypes().getCIRGenRecordLayout(field->getParent());
532+
const CIRGenBitFieldInfo &info = rl.getBitFieldInfo(field);
531533
llvm::APInt fieldValue = ci.getValue();
532534

533535
// Promote the size of FieldValue if necessary

0 commit comments

Comments
 (0)