-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[WIP] ABI Lowering Library #140112
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
base: main
Are you sure you want to change the base?
[WIP] ABI Lowering Library #140112
Conversation
TypeKind Kind; | ||
uint64_t SizeInBits; | ||
uint64_t AlignInBits; | ||
bool IsExplicitlyAligned; |
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.
We're probably going to need more than IsExplicitAligned, but we can deal with it when we get to it.
llvm/include/llvm/ABI/Types.h
Outdated
bool IsSigned; | ||
|
||
public: | ||
IntegerType(uint64_t BitWidth, uint64_t Align, bool Signed) |
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.
We'll have to distinguish __int128 and _BitInt(128) here, but we can deal with that when we get to it.
class VectorType : public Type { | ||
private: | ||
const Type *ElementType; | ||
uint64_t NumElements; |
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.
Should probably be ElementCount for scalable vector support.
StructPacking Pack = StructPacking::Default) { | ||
FieldInfo *FieldArray = Allocator.Allocate<FieldInfo>(Fields.size()); | ||
|
||
for (size_t I = 0; I < Fields.size(); ++I) { |
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.
nit: Avoid braces for single line ifs.
✅ With the latest revision this PR passed the C/C++ code formatter. |
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.
One thing still missing here is handling for C++ structs with base classes.
continue; | ||
|
||
const RecordType *BaseRT = Base.getType()->getAs<RecordType>(); | ||
if (!BaseRT) |
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.
I don't think this can fail. Assert instead?
This PR details the implementation details of the proposed ABI lowering library.