@@ -173,7 +173,7 @@ Type StructType::parse(mlir::AsmParser &parser) {
173173
174174 if (parser.parseOptionalKeyword (" packed" ).succeeded ())
175175 packed = true ;
176-
176+
177177 if (parser.parseOptionalKeyword (" padded" ).succeeded ())
178178 padded = true ;
179179
@@ -273,7 +273,8 @@ void StructType::print(mlir::AsmPrinter &printer) const {
273273mlir::LogicalResult StructType::verifyInvariants (
274274 llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
275275 llvm::ArrayRef<mlir::Type> members, mlir::StringAttr name, bool incomplete,
276- bool packed, bool padded, cir::StructType::RecordKind kind, ASTRecordDeclInterface ast) {
276+ bool packed, bool padded, cir::StructType::RecordKind kind,
277+ ASTRecordDeclInterface ast) {
277278 if (name && name.getValue ().empty ()) {
278279 emitError () << " identified structs cannot have an empty name" ;
279280 return mlir::failure ();
@@ -283,10 +284,10 @@ mlir::LogicalResult StructType::verifyInvariants(
283284
284285void StructType::dropAst () { getImpl ()->ast = nullptr ; }
285286StructType StructType::get (::mlir::MLIRContext *context, ArrayRef<Type> members,
286- StringAttr name, bool packed, bool padded, RecordKind kind,
287- ASTRecordDeclInterface ast) {
288- return Base::get (context, members, name, /* incomplete=*/ false , packed, padded, kind,
289- ast);
287+ StringAttr name, bool packed, bool padded,
288+ RecordKind kind, ASTRecordDeclInterface ast) {
289+ return Base::get (context, members, name, /* incomplete=*/ false , packed, padded,
290+ kind, ast);
290291}
291292
292293StructType StructType::getChecked (
@@ -300,16 +301,17 @@ StructType StructType::getChecked(
300301StructType StructType::get (::mlir::MLIRContext *context, StringAttr name,
301302 RecordKind kind) {
302303 return Base::get (context, /* members=*/ ArrayRef<Type>{}, name,
303- /* incomplete=*/ true , /* packed=*/ false , /* padded=*/ false , kind,
304+ /* incomplete=*/ true , /* packed=*/ false , /* padded=*/ false ,
305+ kind,
304306 /* ast=*/ ASTRecordDeclInterface{});
305307}
306308
307309StructType StructType::getChecked (
308310 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError,
309311 ::mlir::MLIRContext *context, StringAttr name, RecordKind kind) {
310312 return Base::getChecked (emitError, context, ArrayRef<Type>{}, name,
311- /* incomplete=*/ true , /* packed=*/ false , /* padded= */ false , kind,
312- ASTRecordDeclInterface{});
313+ /* incomplete=*/ true , /* packed=*/ false ,
314+ /* padded= */ false , kind, ASTRecordDeclInterface{});
313315}
314316
315317StructType StructType::get (::mlir::MLIRContext *context, ArrayRef<Type> members,
@@ -324,8 +326,7 @@ StructType StructType::getChecked(
324326 ::mlir::MLIRContext *context, ArrayRef<Type> members, bool packed,
325327 bool padded, RecordKind kind, ASTRecordDeclInterface ast) {
326328 return Base::getChecked (emitError, context, members, StringAttr{},
327- /* incomplete=*/ false , packed, padded,
328- kind, ast);
329+ /* incomplete=*/ false , packed, padded, kind, ast);
329330}
330331
331332::llvm::ArrayRef<mlir::Type> StructType::getMembers () const {
@@ -527,10 +528,10 @@ void StructType::computeSizeAndAlignment(
527528 bool dontCountLastElt = isUnion () && getPadded ();
528529 if (dontCountLastElt)
529530 numElements--;
530-
531+
531532 // Loop over each of the elements, placing them in memory.
532533 memberOffsets.reserve (numElements);
533-
534+
534535 for (unsigned i = 0 , e = numElements; i != e; ++i) {
535536 auto ty = members[i];
536537
@@ -571,7 +572,7 @@ void StructType::computeSizeAndAlignment(
571572 structSize = largestMemberSize;
572573 if (getPadded ()) {
573574 memberOffsets.push_back (mlir::IntegerAttr::get (
574- mlir::IntegerType::get (getContext (), 32 ), structSize));
575+ mlir::IntegerType::get (getContext (), 32 ), structSize));
575576 auto ty = getMembers ()[numElements];
576577 structSize += dataLayout.getTypeSize (ty);
577578 isPadded = true ;
@@ -1067,9 +1068,8 @@ static mlir::Type getMethodLayoutType(mlir::MLIRContext *ctx) {
10671068 // TODO: consider member function pointer layout in other ABIs
10681069 auto voidPtrTy = cir::PointerType::get (cir::VoidType::get (ctx));
10691070 mlir::Type fields[2 ]{voidPtrTy, voidPtrTy};
1070- return cir::StructType::get (ctx, fields, /* packed=*/ false ,
1071- /* padded=*/ false ,
1072- cir::StructType::Struct);
1071+ return cir::StructType::get (ctx, fields, /* packed=*/ false ,
1072+ /* padded=*/ false , cir::StructType::Struct);
10731073}
10741074
10751075llvm::TypeSize
0 commit comments