-
Notifications
You must be signed in to change notification settings - Fork 0
Resolve symbol types in symbol table #2
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
Resolve symbol types in symbol table #2
Conversation
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.
Also, we should figure out how to synchronize this branch with @smowton's original branch....
irept &irep, | ||
const namespacet &ns) | ||
{ | ||
if(irep.id() == ID_symbol) |
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.
Can't this whole if block be replaced with a single call to ns.follow_symbol(irep) ?
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.
The follow_symbol()
method follows both type symbols and non-type symbols, but we only want to replace type symbols. So we first do the check if(symbol.is_type)
and only do the follow in this case.
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.
Ah, right - got it... A couple of observations:
- This should probably be renamed to
follow_type_symbols
to match the naming offollow_symbols
- Should either this
follow_type_symbols
function be moved intonamespace.cpp
as a utility function there, or should ns.follow_symbol() grow an extra argument (with a default value) that specifies whether to follow non-type symbols or not, and then just use that where we need it instead?
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.
Ah yes. I think I'll move the new follow_type_symbols
function to namespace.cpp
.
af2e8bd
to
e262b18
Compare
e262b18
to
95af4f9
Compare
5d0c656
into
chrisr-diffblue:external_parser_support_rebase
We should keep the struct tag type, not follow it and get the struct type
This resolves the type symbols to the pointed-to types in the symbol table before creating the goto program, when reading a json goto program file.