-
Notifications
You must be signed in to change notification settings - Fork 12
Define package body symbol #231
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
Define package body symbol #231
Conversation
-- Now compile the body of the subprogram | ||
Unit_Symbol.Value := Do_Subprogram_Or_Block (U); | ||
-- Now compile the body of the subprogram | ||
Unit_Symbol.Value := Do_Subprogram_Or_Block (U); |
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.
Is this supposed to be the elaboration code for the package?
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.
No. It just gives a valid symbol. In the code for Do_Compilation_Unit this symbol is inserted into the symbol table. I did not try to rewrite the existing code of Do_Compilation_Unit, just provide a valid symbol to insert.
The elaboration code needs further thought. We need to provide initialisation code which can be called prior to calling the designated main program.
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.
LGTM
I still don't quite understand what we need a package symbol in the symbol table for |
@xbauch @tjj2017 - Does this PR replace/supeceed/subsume #230, or is it just dependent on #230? If it replaces #230 could you please close the #230 PR - or alternatively, if this PR has now been merged into #230, could this one be closed :-) I'd just like to be clear one which of these two PRs needs to be merged :-) |
This PR supersedes PR #230. I have rebased this branch with the latest diff/blue master. |
65cb551
to
bafda79
Compare
@chrisr-diffblue and @tjj2017 Well I rebased (and updated the golden results) but @hannes-steffenhagen-diffblue's question is still open, i.e. why do we need the package symbol in the symbol table? |
Not need to review here.
In the interests of reducing the backlog of PRs we have, I think we should merge this and then discuss/resolve the question of why/whether we need the package symbol in the symbol table separately. |
to Unit_Symbol for a package body. To determine a symbol value for a package body a symbol is determined from its specification and registered in the symbol table. This required checking for the package being a child. N.b.: The same check may be required for child subprograms!
bafda79
to
a6aacc3
Compare
This is a refactor of #230 with updated golden results. Copy of its description:
In Do_Compilation_Unit the return value Unit_Symbol was not set for a package body
To determine a symbol value for a package body a symbol is determined from
its specification and registered in the symbol table. This required checking for
the package being a child.
Note: The same check may be required for child subprograms!