This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add -fdump-record-layouts-canonical option
ClosedPublic

Authored by daltenty on Jun 29 2021, 6:16 AM.

Details

Summary

This option implies -fdump-record-layouts but dumps record layout information with canonical field types, which can be more useful in certain cases when comparing structure layouts.

Diff Detail

Event Timeline

daltenty created this revision.Jun 29 2021, 6:16 AM
daltenty requested review of this revision.Jun 29 2021, 6:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2021, 6:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I'm not familiar with getCanonicalType(), can you confirm whether it sees through nested typedef's?

daltenty updated this revision to Diff 355741.Jun 30 2021, 6:14 PM
  • Update test case with nested typedef
daltenty added a comment.EditedJun 30 2021, 6:15 PM

I'm not familiar with getCanonicalType(), can you confirm whether it sees through nested typedef's?

Added a test case that hopefully will cover the case you intend

stevewan accepted this revision.Jul 5 2021, 10:52 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Jul 5 2021, 10:52 AM
This revision was landed with ongoing or failed builds.Jul 5 2021, 2:39 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Jul 5 2021, 3:33 PM

Hi, you have to bump clang/include/clang/Serialization/ASTBitCodes.h's VERSION_MAJOR after adding a LangOption, else builds with LLVM_APPEND_VC_REV=NO won't invalidate their module cache correctly. See e.g. https://reviews.llvm.org/rGb8b7a9dcdcbc Without that, tests are broken on bots with LLVM_APPEND_VC_REV=NO , eg http://45.33.8.238/linux/50460/step_7.txt

Hi, you have to bump clang/include/clang/Serialization/ASTBitCodes.h's VERSION_MAJOR after adding a LangOption, else builds with LLVM_APPEND_VC_REV=NO won't invalidate their module cache correctly. See e.g. https://reviews.llvm.org/rGb8b7a9dcdcbc Without that, tests are broken on bots with LLVM_APPEND_VC_REV=NO , eg http://45.33.8.238/linux/50460/step_7.txt

Posted fix rGe2904c8e0fa901adeefe579297cb2ece2757fb18. Sorry for the churn.

thakis added a comment.Jul 5 2021, 5:15 PM

Thanks for the fix :)