-
Notifications
You must be signed in to change notification settings - Fork 182
[CIR] Add support for DumpRecordLayouts #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
andykaylor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this! Can you add a test to verify the output?
| assert(it != BitFields.end() && "Unable to find bitfield info"); | ||
| return it->second; | ||
| } | ||
| void print(raw_ostream &os) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very handy to have an additional method, dump() which prints to llvm::errs() and is marked with LLVM_DUMP_METHOD. This lets you print the object from a debugger.
| os << "<CIRecordLayout\n"; | ||
| os << " CIR Type:" << CompleteObjectType << "\n"; | ||
| if (BaseSubobjectType) | ||
| os << " NonVirtualBaseLLVMType:" << BaseSubobjectType << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| os << " NonVirtualBaseLLVMType:" << BaseSubobjectType << "\n"; | |
| os << " NonVirtualBaseCIRType:" << BaseSubobjectType << "\n"; |
This PR adds support for the `-fdump-record-layouts` flag. It enables printing both the `CIRGenRecordLayout` and the `ASTRecordLayout`, similar to what is done in CodeGen.
This PR adds support for the
-fdump-record-layoutsflag. It enables printing both theCIRGenRecordLayoutand theASTRecordLayout, similar to what is done in CodeGen.