Add a function to flatten the nested aggregate type
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp | ||
---|---|---|
1563 ↗ | (On Diff #202294) | NIT: faltten -> flatten |
1568 ↗ | (On Diff #202294) | I really wish that we could just use CGFunctionInfo::getReturnInfo().getKind() |
1678 ↗ | (On Diff #202294) | Hmm, dead code? |
1810 ↗ | (On Diff #202294) | The braces are extraneous |
1811 ↗ | (On Diff #202294) | The braces are extraneous |
lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp | ||
---|---|---|
1568 ↗ | (On Diff #202294) | that's clang. I can try simplify it using ·GetFieldAtIndex·. this just incase we need to check child_is_base_class |
simplify the method in 'FlattenAggregateType'
added test for nested struct returned in registers
Actually, I think that we should extend CompilerType and TypeSystem to expose Clang's knowledge of whether a type is passed in a register by means of using clang::RecordDecl::isPassInRegisters
added a virtual function CanPassInRegister in TypeSystem class
to provide info about type can be passed in register or not
ClangASTContext will refer to clang::RecordDecl::canPassInRegister for this info
and later SwiftASTContext can provide the equivalent
updated the test to test on C++
and provided class test, including base class, subclass, abstract class (this one must be in memory)
lldb/source/Symbol/ClangASTContext.cpp | ||
---|---|---|
3915 ↗ | (On Diff #202517) | I think that using auto instead of clang::RecordDecl here is fine as you are already spelling that out in the ClangASTContext::GetAsRecordDecl. |
lldb/source/Symbol/ClangASTContext.cpp | ||
---|---|---|
3915 ↗ | (On Diff #202517) | got it |
- Limit the TestReturnValue for nested struct and class (cpp support) to only x86_64
- This patch somehow fix the bug: pr36870 for Systerm V ABI (windows is waiting for this change to go in). So I change the test to allow passing on SysV-x86_64