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

Fix for issues #138 and #141 #147

Merged
merged 3 commits into from
Nov 15, 2016
Merged

Fix for issues #138 and #141 #147

merged 3 commits into from
Nov 15, 2016

Conversation

mihaibudiu
Copy link
Contributor

Moved a pass from mid-end to front-end.
Some bug-fixes in def-use computation.
The originalName of an ID can be nullptr; this is not the same as the name.

@ChrisDodd ChrisDodd self-assigned this Nov 15, 2016
auto fields = new IR::IndexedVector<IR::StructField>();
for (auto f : *st->fields) {
auto ftype = typeMap->getType(f);
auto cftype = convertType(ftype);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this really need to look up the type in the typemap rather than just using f->type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, because the field type may be just a Type_Name; the typeMap holds the canonical type.
Please note that a new Type_Type has been introduced in a previous commit: it represents the type of a type... So to retrieve the field type you can do either:

typeMap->getType(field);
or
typeMap->getTypeType(field->type);

Copy link
Contributor

Choose a reason for hiding this comment

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

This should only run after type inferencing has successfully run, so any parameterized type should have been replaced by a specialized type with all the Type_Names replaced with concrete types. So there should never be a Type_Name here.

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