-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Methods for getting indices and making loads and stores #500
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.
Marking as draft since I forgot to look into CodeMatch stuff |
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
Almost done. Just the last rename. Code quality is great. |
What do you mean the last rename? I don't see any comments that I didn't address with my force-push. :) |
Extensions.cs:505 |
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?
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: ***@***.***>
|
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? |
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.