Better discoverability of IL.Push/IL.Pop
Closed this issue · 2 comments
Rohansi commented
DeclareLocals
is really useful to have but it'd also be nice to reference normal C# locals too. I just noticed there's also Push
and Pop
so maybe the error could point to those, but maybe the names can be changed to Load
and Store
to match IL opcode names more?
ltrzesniewski commented
Yes, Push
and Pop
are there for this purpose. I guess they could have been named Load
and Store
but I'm reluctant to take a breaking change just for renaming them right now.
I see no other way to reference normal C# locals, because they can get optimized out in release builds, and there's no way to map C# local names to IL locals.
Can you tell me which error message you got, so I can improve it?
Rohansi commented
Oh right, I forgot they would be optimized out.
I don't have the exact error message but I believe it was number 0002 and it suggested to use DeclareLocals. That hint could be expanded to include Push and Pop in case a user is trying to access a C# local.
On Jul 22, 2018 8:08 AM, Lucas Trzesniewski <notifications@github.com> wrote:
Yes, Push and Pop are there for this purpose. I guess they could have been named Load and Store but I'm reluctant to take a breaking change just for renaming them right now.
I see no other way to reference normal C# locals, because they can get optimized out in release builds, and there's no way to map C# local names to IL locals.
Can you tell me which error message you got, so I can improve it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#3 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABQjzPs3sNCN1hGRmREpAGiFLDcRebTYks5uJGtMgaJpZM4VZ-FK>.