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

7903649: Field and global variables of array type should have indexed accessors #198

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ class HeaderFileBuilder extends ClassSourceBuilder {

public void addVar(Declaration.Variable varTree) {
String javaName = JavaName.getOrThrow(varTree);
appendBlankLine();
String holderClass = emitVarHolderClass(varTree, javaName);
if (Utils.isArray(varTree.type()) || Utils.isStructOrUnion(varTree.type())) {
emitGlobalSegmentGetter(holderClass, javaName, varTree, "Getter for variable:");
1 change: 1 addition & 0 deletions src/main/java/org/openjdk/jextract/impl/StructBuilder.java
Original file line number Diff line number Diff line change
@@ -135,6 +135,7 @@ public void addVar(Declaration.Variable varTree) {
String javaName = JavaName.getOrThrow(varTree);
appendBlankLine();
String layoutField = emitLayoutFieldDecl(varTree, javaName);
appendBlankLine();
String offsetField = emitOffsetFieldDecl(varTree, javaName);
if (Utils.isArray(varTree.type()) || Utils.isStructOrUnion(varTree.type())) {
emitDimensionsFieldDecl(varTree, javaName);
Copy link
Member

Choose a reason for hiding this comment

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

Are we always emitting DIMS field, even for structs? Should this be moved into the dims > 0 if block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this seems a mistake