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 issue #133 #135

Closed
wants to merge 8 commits into from
Closed

Fix for issue #133 #135

wants to merge 8 commits into from

Conversation

mihaibudiu
Copy link
Contributor

No description provided.

namespace BMV2 {

const IR::Node* DoCopyStructures::postorder(IR::AssignmentStatement* statement) {
auto ltype = typeMap->getType(statement->left, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a preorder so that assignments of nested structs will get flattened properly too? However, that would likely require fixing the code to use and maintain the types in the expression nodes properly, rather than the typeMap, which will be out of date after the first flattening.

"size"
};
for (size_t i=0; i < ELEMENTS(knownProperties); i++)
if (property->name.name == knownProperties[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer for (auto propName : knownProperties) for this kind of loop. Or even something like

static std::set<cstring> knownProperties = { ... };
if (!knownProperties.count(property->name))
    warning(...

@ChrisDodd
Copy link
Contributor

merged as 6bd98d1 -- rebase you branch on to master.

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