Skip to content

Commit ff99bfc

Browse files
committed
Add MissingFeature for zero size member, fix var naming
1 parent a35eaf0 commit ff99bfc

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
9595
return getZeroAttr(arrTy);
9696
if (auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
9797
return getConstNullPtrAttr(ptrTy);
98-
if (auto RecordTy = mlir::dyn_cast<cir::RecordType>(ty))
99-
return getZeroAttr(RecordTy);
98+
if (auto recordTy = mlir::dyn_cast<cir::RecordType>(ty))
99+
return getZeroAttr(recordTy);
100100
if (mlir::isa<cir::BoolType>(ty)) {
101101
return getCIRBoolAttr(false);
102102
}

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ struct MissingFeatures {
110110
static bool packedRecords() { return false; }
111111
static bool recordPadding() { return false; }
112112
static bool recordZeroInit() { return false; }
113+
static bool zeroSizeRecordMembers() { return false; }
113114

114115
// Misc
115116
static bool cxxABI() { return false; }

clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ void CIRRecordLowering::accumulateFields() {
180180
++field;
181181
} else {
182182
// TODO(cir): do we want to do anything special about zero size members?
183+
assert(!cir::MissingFeatures::zeroSizeRecordMembers());
183184
++field;
184185
}
185186
}

0 commit comments

Comments
 (0)