Skip to content
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

update Cppyy::GetDatamemberOffset to handle multiple inheritance #69

Merged

Conversation

Vipul-Cariappa
Copy link
Collaborator

depends on compiler-research/cppyy-backend#118
And that in turn depends on this PR.

There is a cyclic dependency here.

src/Cppyy.h Outdated
@@ -324,7 +324,7 @@ namespace Cppyy {
CPPYY_IMPORT
std::string GetDatamemberTypeAsString(TCppScope_t var);
CPPYY_IMPORT
intptr_t GetDatamemberOffset(TCppScope_t var);
intptr_t GetDatamemberOffset(TCppScope_t var, TCppScope_t parent = nullptr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get the enclosing scope from var here, can't we?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible in the case of derived class.
var->getParent() will return the base class.
But we want to calculate the offset with respect to the derived class.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case then we should change the name of the parameter. It is not parent according to your description.

Copy link

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Vipul-Cariappa Vipul-Cariappa merged commit 373d3fb into compiler-research:master Dec 20, 2024
15 checks passed
@Vipul-Cariappa Vipul-Cariappa deleted the dev/offset-inheritance branch December 20, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants