-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Fix call graph with respect to constants. #11014
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
Conversation
@cameel can you add tests to this, please? |
Sure. |
Tests ready. Unfortunately they don't pass so it looks like the fix is not enough. It fixes constants but for immutables, ordinary variables or even referencing the selector in a function body an edge to the internal dispatch is still being added. @chriseth Should I take it over and fix these cases? |
@cameel can you summarize the problems? Immutables should have the same behaviour as regular state variables. The expression |
Sorry, it's actually an edge from the dispatch, not to the dispatch that is being added. So anyway, the problems I was referring to were just all of these adding these edges from dispatch: bytes4 immutable pubImmutable = Base.pub.selector; bytes4 pubVar = Base.pub.selector; return (Base.ext.selector, Base.pub.selector); The functions are not being called here and I think you can't call them internally via the But you have a point about the IR codegen. I think it does add them to the dispatch when it's visiting |
70fa50f
to
5dc0dce
Compare
@chriseth Expectations updated. |
I have also pushed a fixup that fixes the case found by @bshastry in #11014 (comment) |
Looks good! Please rebaes. |
5dc0dce
to
186d14d
Compare
Rebased and squashed. |
Approving. |
Fixes #11007