Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Support for generation of PInvoke transitions - #1255

Merged
jkotas merged 1 commit into
dotnet:masterfrom
jkotas:pinvoke-work
May 10, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
jkotas:pinvoke-work

Conversation

@jkotas

@jkotas jkotas commented May 8, 2016

Copy link
Copy Markdown
Member

No description provided.

@jkotas

jkotas commented May 8, 2016

Copy link
Copy Markdown
Member Author

This is the compiler part for the PInvoke transitions.

{
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is RequiresMarshalling still a fitting name for this method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Sigh, maybe PInvokeMarshallingILEmitter should be just PInvokeILEmitter too.)

@jkotas

jkotas commented May 8, 2016

Copy link
Copy Markdown
Member Author

Is RequiresMarshalling still a fitting name for this method?

Rename it to IsStubRequired.

@jkotas

jkotas commented May 9, 2016

Copy link
Copy Markdown
Member Author

@MichalStrehovsky PTLA

{
var builder = new CppGenerationBuffer();
switch (kind)
bool isPInvoke;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bool makes readability of the code a bit worse (it's non-obvious that the bool being false means it's a runtime import). Maybe we could factor out a new method that takes the original MethodDesc and the importName string to alleviate that.

But I don't care much. CppWriter is not particularly readable anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have refactored it as CompileExternMethod

@MichalStrehovsky

Copy link
Copy Markdown
Member

LGTM

@jkotas
jkotas merged commit fe1ec1e into dotnet:master May 10, 2016
@jkotas
jkotas deleted the pinvoke-work branch May 10, 2016 05:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants