@@ -43,7 +43,7 @@ using namespace clang::CIRGen;
43
43
namespace {
44
44
class ConstExprEmitter ;
45
45
46
- mlir::TypedAttr getPadding (CIRGenModule &CGM, CharUnits size) {
46
+ static mlir::TypedAttr computePadding (CIRGenModule &CGM, CharUnits size) {
47
47
auto eltTy = CGM.UCharTy ;
48
48
auto arSize = size.getQuantity ();
49
49
auto &bld = CGM.getBuilder ();
@@ -83,7 +83,7 @@ struct ConstantAggregateBuilderUtils {
83
83
}
84
84
85
85
mlir::TypedAttr getPadding (CharUnits size) const {
86
- return :: getPadding (CGM, size);
86
+ return computePadding (CGM, size);
87
87
}
88
88
89
89
mlir::Attribute getZeroes (CharUnits ZeroSize) const {
@@ -517,7 +517,7 @@ class ConstStructBuilder {
517
517
bool Build (const APValue &Val, const RecordDecl *RD, bool IsPrimaryBase,
518
518
const CXXRecordDecl *VTableClass, CharUnits BaseOffset);
519
519
520
- bool DoZeroInitPadding (const ASTRecordLayout &Layout, unsigned FieldNo,
520
+ bool ApplyZeroInitPadding (const ASTRecordLayout &Layout, unsigned FieldNo,
521
521
const FieldDecl &Field, bool AllowOverwrite,
522
522
CharUnits &SizeSoFar, bool &ZeroFieldSize);
523
523
@@ -660,7 +660,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE, bool AllowOverwrite) {
660
660
}
661
661
662
662
if (ZeroInitPadding &&
663
- !DoZeroInitPadding (Layout, FieldNo, *Field, AllowOverwrite, SizeSoFar,
663
+ !ApplyZeroInitPadding (Layout, FieldNo, *Field, AllowOverwrite, SizeSoFar,
664
664
ZeroFieldSize))
665
665
return false ;
666
666
@@ -806,15 +806,15 @@ bool ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD,
806
806
return true ;
807
807
}
808
808
809
- bool ConstStructBuilder::DoZeroInitPadding (
809
+ bool ConstStructBuilder::ApplyZeroInitPadding (
810
810
const ASTRecordLayout &Layout, unsigned FieldNo, const FieldDecl &Field,
811
811
bool AllowOverwrite, CharUnits &SizeSoFar, bool &ZeroFieldSize) {
812
812
813
813
uint64_t StartBitOffset = Layout.getFieldOffset (FieldNo);
814
814
CharUnits StartOffset =
815
815
CGM.getASTContext ().toCharUnitsFromBits (StartBitOffset);
816
816
if (SizeSoFar < StartOffset) {
817
- if (!AppendBytes (SizeSoFar, getPadding (CGM, StartOffset - SizeSoFar),
817
+ if (!AppendBytes (SizeSoFar, computePadding (CGM, StartOffset - SizeSoFar),
818
818
AllowOverwrite))
819
819
return false ;
820
820
}
0 commit comments