Skip to content

Commit 6b1f369

Browse files
committed
minor changes after review
1 parent 70d134a commit 6b1f369

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/lib/CIR/CodeGen/CIRGenExprConst.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ using namespace clang::CIRGen;
4343
namespace {
4444
class ConstExprEmitter;
4545

46-
mlir::TypedAttr getPadding(CIRGenModule &CGM, CharUnits size) {
46+
static mlir::TypedAttr computePadding(CIRGenModule &CGM, CharUnits size) {
4747
auto eltTy = CGM.UCharTy;
4848
auto arSize = size.getQuantity();
4949
auto &bld = CGM.getBuilder();
@@ -83,7 +83,7 @@ struct ConstantAggregateBuilderUtils {
8383
}
8484

8585
mlir::TypedAttr getPadding(CharUnits size) const {
86-
return ::getPadding(CGM, size);
86+
return computePadding(CGM, size);
8787
}
8888

8989
mlir::Attribute getZeroes(CharUnits ZeroSize) const {
@@ -517,7 +517,7 @@ class ConstStructBuilder {
517517
bool Build(const APValue &Val, const RecordDecl *RD, bool IsPrimaryBase,
518518
const CXXRecordDecl *VTableClass, CharUnits BaseOffset);
519519

520-
bool DoZeroInitPadding(const ASTRecordLayout &Layout, unsigned FieldNo,
520+
bool ApplyZeroInitPadding(const ASTRecordLayout &Layout, unsigned FieldNo,
521521
const FieldDecl &Field, bool AllowOverwrite,
522522
CharUnits &SizeSoFar, bool &ZeroFieldSize);
523523

@@ -660,7 +660,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE, bool AllowOverwrite) {
660660
}
661661

662662
if (ZeroInitPadding &&
663-
!DoZeroInitPadding(Layout, FieldNo, *Field, AllowOverwrite, SizeSoFar,
663+
!ApplyZeroInitPadding(Layout, FieldNo, *Field, AllowOverwrite, SizeSoFar,
664664
ZeroFieldSize))
665665
return false;
666666

@@ -806,15 +806,15 @@ bool ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD,
806806
return true;
807807
}
808808

809-
bool ConstStructBuilder::DoZeroInitPadding(
809+
bool ConstStructBuilder::ApplyZeroInitPadding(
810810
const ASTRecordLayout &Layout, unsigned FieldNo, const FieldDecl &Field,
811811
bool AllowOverwrite, CharUnits &SizeSoFar, bool &ZeroFieldSize) {
812812

813813
uint64_t StartBitOffset = Layout.getFieldOffset(FieldNo);
814814
CharUnits StartOffset =
815815
CGM.getASTContext().toCharUnitsFromBits(StartBitOffset);
816816
if (SizeSoFar < StartOffset) {
817-
if (!AppendBytes(SizeSoFar, getPadding(CGM, StartOffset - SizeSoFar),
817+
if (!AppendBytes(SizeSoFar, computePadding(CGM, StartOffset - SizeSoFar),
818818
AllowOverwrite))
819819
return false;
820820
}

0 commit comments

Comments
 (0)