-
Notifications
You must be signed in to change notification settings - Fork 114
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
implement inlining for call attributes #980
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.
This looks nice. I made a couple of stylistic comments, but feel free to take them or leave them.
Source/Core/Inline.cs
Outdated
|
||
public int getDepth(Implementation impl) { | ||
var procName = getName(impl); | ||
var c = -1; |
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.
I think this line is redundant. You could probably use out var c
in the line below and leave this line out.
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.
Oh i didn't know that writing out var c
defines c.
protected Dictionary<string, int> procUnrollDepth = new(); | ||
protected Dictionary<string, CallCmd> procUnrollSrc = new(); | ||
|
||
private string getName (Implementation impl) { |
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.
Please remove the redundant space and use PascalCase for method names, as is the C# convention. If you use a C# IDE then it'll alert you to the incorrect name. We should add a stylistic checker to the Boogie CI
Description
This PR implements support for inlining based on call sites, while maintaining the behavior of inlining based on procedure definitions. When there is a clash, the inlining depth specified at the call site "wins", because its more precise.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.