Skip to content
Snippets Groups Projects
Commit 89525cbf authored by William S. Moses's avatar William S. Moses
Browse files

[Clang] Add helper method to determine if a nonvirtual base has an entry in the LLVM struct

This patch adds a helper method to determine if a nonvirtual base has an entry in the LLVM struct. Such a base may not have an entry
if the base does not have any fields/bases itself that would change the size of the struct. This utility method is useful for other frontends (Polygeist) that use Clang as an API to generate code.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D122502
parent 6aa03977
No related branches found
No related tags found
No related merge requests found
......@@ -200,6 +200,12 @@ public:
return FieldInfo.lookup(FD);
}
// Return whether the following non virtual base has a corresponding
// entry in the LLVM struct.
bool hasNonVirtualBaseLLVMField(const CXXRecordDecl *RD) const {
return NonVirtualBases.count(RD);
}
unsigned getNonVirtualBaseLLVMFieldNo(const CXXRecordDecl *RD) const {
assert(NonVirtualBases.count(RD) && "Invalid non-virtual base!");
return NonVirtualBases.lookup(RD);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment