Methods for getting indices and making loads and stores#500
Merged
pardeike merged 3 commits intopardeike:masterfrom Oct 4, 2022
LoganDark:local-index
Merged
Methods for getting indices and making loads and stores#500pardeike merged 3 commits intopardeike:masterfrom LoganDark:local-index
pardeike merged 3 commits intopardeike:masterfrom
LoganDark:local-index
Conversation
Adds these extension methods on CodeInstruction: - LocalIndex, which returns the operand of any ldloc/ldloca/stloc, even the short forms or the fixed forms (i.e. ldloc.s or ldloc.1) - ArgIndex, which does the same but for ldarg/ldarga/starg Adds these static helper methods to CodeInstruction: - LoadLocal, which allows you to produce an optimal load from an index, optionally loading the address - StoreLocal, which allows you to produce an optional store to an index - LoadArg, which allows you to produce an optimal load from an argument, optionally loading the address - StoreArg, which allows you to produce an optimal store to an argument All of the methods are annotated with doc comments and include links to their counterparts via `<seealso>` references.
Contributor
Author
|
Marking as draft since I forgot to look into CodeMatch stuff |
pardeike
reviewed
Oct 3, 2022
pardeike
reviewed
Oct 3, 2022
pardeike
reviewed
Oct 3, 2022
pardeike
reviewed
Oct 3, 2022
pardeike
reviewed
Oct 3, 2022
This adds four new static methods to CodeMatch: - LoadsLocal which matches any local load (ldloc family) - StoresLocal which matches any local store (stloc family) - LoadsArgument which matches any argument load (ldarg family) - StoresArgument which matches any argument store (starg family) Matching specific indices can be done with the predicate and checking the instruction LocalIndex or ArgIndex
Owner
|
Almost done. Just the last rename. Code quality is great. |
Contributor
Author
What do you mean the last rename? I don't see any comments that I didn't address with my force-push. :) |
Owner
|
Extensions.cs:505 |
Contributor
Author
There's no comment there. What did you want it changed to? |
I'm having trouble getting feedback on this one but I think this is what we want?
Owner
|
Yeah, as you see in my screenshot it shows Pending for me. On 4 Oct 2022, at 09:40, LoganDark ***@***.***> wrote:
Extensions.cs:505
There's no comment there. What did you want it changed to? ArgumentIndex?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Contributor
Author
I can't actually see your screenshot (uh, did you post it somewhere?) but it says pending review because I re-requested after addressing your comments. (If you sent a screenshot over email as an attachment, GitHub didn't put it in your comment.) Does this look good to merge now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds these extension methods on CodeInstruction:
LocalIndex, which returns the operand of any ldloc/ldloca/stloc, even the short forms or the fixed forms (i.e. ldloc.s or ldloc.1)
ArgIndex, which does the same but for ldarg/ldarga/starg
Adds these static helper methods to CodeInstruction:
LoadLocal, which allows you to produce an optimal load from an index, optionally loading the address
StoreLocal, which allows you to produce an optional store to an index
LoadArg, which allows you to produce an optimal load from an argument, optionally loading the address
StoreArg, which allows you to produce an optimal store to an argument
All of the methods are annotated with doc comments and include links to their counterparts via
<seealso>references.Please let me know if I got the names, documentation, or code style (I'm used to OTB) incorrect.