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

Add temporary IR nodes to typeMap #2972

Merged
merged 1 commit into from
Dec 1, 2021
Merged

Conversation

mihaibudiu
Copy link
Contributor

Fixes #2958

@mihaibudiu
Copy link
Contributor Author

@kostasyrmia please review this; it looks like the bug is in your code.

@kostasyrmia
Copy link
Contributor

Yes, you are right, this is definitely in my code.

I tried to avoid inserting these temporary fields into the typeMap, but it seems it has to be done...

The only thing that I would do additionally is removing dst_type and src_type from the signature of processHeadersInAssignment, because they no longer have any usage now that everything is in the typeMap.

I think that this:

void processHeadersInAssignment(const IR::Expression* dst, const IR::Expression* src,
                                    const IR::Type* dst_type, const IR::Type* src_type) {
    // code inside the function
}

can be changed to something like this:

void processHeadersInAssignment(const IR::Expression* dst, const IR::Expression* src) {
    auto dst_type = typeMap->getType(dst, true);
    auto src_type = typeMap->getType(src, true);

    // code inside the function
}

But also it's okay for me as it is.

Thank you for the fix!

@mihaibudiu mihaibudiu merged commit f12dc2e into p4lang:main Dec 1, 2021
@mihaibudiu mihaibudiu deleted the issue2958 branch December 1, 2021 23:36
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.

Compiler Bug: Could not find type for <Member>
3 participants