Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ struct CIRRecordLowering final {
// Output fields, consumed by CIRGenTypes::computeRecordLayout
llvm::SmallVector<mlir::Type, 16> fieldTypes;
llvm::DenseMap<const FieldDecl *, unsigned> fields;
bool zeroInitializable : 1;
bool packed : 1;
bool padded : 1;

LLVM_PREFERRED_TYPE(bool)
unsigned zeroInitializable : 1;
LLVM_PREFERRED_TYPE(bool)
unsigned packed : 1;
LLVM_PREFERRED_TYPE(bool)
unsigned padded : 1;

private:
CIRRecordLowering(const CIRRecordLowering &) = delete;
Expand All @@ -126,6 +130,12 @@ void CIRRecordLowering::lower() {
return;
}

if (isa<CXXRecordDecl>(recordDecl)) {
cirGenTypes.getCGModule().errorNYI(recordDecl->getSourceRange(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my! This ends up being harsher than I expected! This means no record-types in C++ at all (even ones that don't do anything). But if that is the level of support we have, I'm ok with it.

I presume a soon-to-be used patch will reduce this to '!virtual && !getNumBases` etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, yes. We aren't handling CXXRecordDecl in the code that gets here yet. I don't expect there to be much more than adding a switch statement for that, but everything in C++ ends up being more involved than I realized, so who knows.

"lower: class");
return;
}

assert(!cir::MissingFeatures::cxxSupport());

accumulateFields();
Expand Down
Loading