This is an archive of the discontinued LLVM Phabricator instance.

TypeInfo records more information about align requirement
ClosedPublic

Authored by stevewan on Aug 27 2021, 9:40 PM.

Details

Summary

Extend the information preserved in TypeInfo by replacing the AlignIsRequired bool flag with a three-valued enum, the enum also indicates where the alignment attribute come from, which could be helpful in determining whether the attribute should overrule.

Diff Detail

Event Timeline

stevewan requested review of this revision.Aug 27 2021, 9:40 PM
stevewan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2021, 9:40 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
stevewan edited the summary of this revision. (Show Details)Aug 27 2021, 9:41 PM
stevewan added a reviewer: rjmccall.
stevewan updated this revision to Diff 369235.Aug 27 2021, 9:56 PM

Oops missed one flag.

stevewan updated this revision to Diff 369240.Aug 27 2021, 11:14 PM

Fix enum usage

Thanks. Generally looks good; feel free to commit after adding a RequiredByEnum case and making sure it compiles.

clang/lib/AST/ASTContext.cpp
2300

Oh, I guess "record" is imprecise here. We might as well add a RequiredByEnum case, then, just to be fully accurate; there's no real harm to it.

clang/lib/AST/RecordLayoutBuilder.cpp
1981

Bug here.

stevewan updated this revision to Diff 369258.Aug 28 2021, 7:27 AM

Add RequiredByEnum case

rjmccall accepted this revision.Aug 28 2021, 12:15 PM

Thanks, LGTM

This revision is now accepted and ready to land.Aug 28 2021, 12:15 PM