================
@@ -532,16 +588,25 @@ mlir::Type adjustGlobalTypeForInit(mlir::Type llvmType, 
mlir::Attribute init,
   // Structs can have a flexible array member, adjust that.
   if (mlir::isa<cir::StructType>(constRecord.getType()))
     return adjustGlobalStructTypeForInit(structTy, constRecord, converter,
-                                         dataLayout);
+                                         dataLayout, paddingAddedIndexes);
   if (mlir::isa<cir::UnionType>(constRecord.getType()))
     return adjustGlobalUnionTypeForInit(structTy, constRecord, converter,
                                         dataLayout);
   return llvmType;
 }
 
+mlir::Type adjustGlobalTypeForInit(mlir::Type llvmType, mlir::Attribute init,
+                                   const mlir::TypeConverter &converter,
+                                   const mlir::DataLayout &dataLayout) {
+  llvm::SmallVector<unsigned> ignoredAddedIndexes;
+  return adjustGlobalTypeForInit(llvmType, init, converter, dataLayout,
+                                 ignoredAddedIndexes);
----------------
erichkeane wrote:

Yeah, it is possible/expected for this to not be empty.  Only one of the uses 
actually cares about those added indexes, so use this version.  For example, 
when we lower the global, we don't care about these, but when we do the same 
call for the `ConstRecordAttr` we DO care about it (and is the only use of the 
'other' version of this.

https://github.com/llvm/llvm-project/pull/216349
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to