Skip to content
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 missing apis #112

Merged
merged 3 commits into from Aug 19, 2019

Conversation

@AviAvni
Copy link
Contributor

commented Aug 13, 2019

missing apis while porting some of my code from https://www.nuget.org/packages/swigged.llvm/
to LLVMSharp v8

return span.Slice(0, span.IndexOf((byte)'\0')).AsString();
}

public bool EmitToFile(LLVMModuleRef module, string fileName, LLVMCodeGenFileType codegen, out string message)

This comment has been minimized.

Copy link
@tannergooding

tannergooding Aug 13, 2019

Member

nit: This should be TryEmitToFile and there should optionally be a corresponding string EmitToFile which throws on failure (this follows the .NET Framework design guidelines).

This comment has been minimized.

Copy link
@AviAvni

AviAvni Aug 15, 2019

Author Contributor

@tannergooding Thanks fixed

{
sbyte* pMessage;

int result = LLVM.TargetMachineEmitToFile(this, module, marshaledFileName, codegen, &pMessage);

This comment has been minimized.

Copy link
@tannergooding

tannergooding Aug 15, 2019

Member

Based on the docs, we need to call LLVMDisposeMessage on errorMessage after marshaling it to managed code. It would probably be good to explicitly call it errorMessage as well, so it is clear to the consumer its intent.

Otherwise, the changes LGTM. Thanks!

This comment has been minimized.

Copy link
@AviAvni

AviAvni Aug 19, 2019

Author Contributor

@tannergooding thanks fixed

@tannergooding tannergooding merged commit f986236 into microsoft:master Aug 19, 2019

10 checks passed

license/cla All CLA requirements met.
Details
microsoft.LLVMSharp Build #20190819.1 succeeded
Details
microsoft.LLVMSharp (macos_debug_x64) macos_debug_x64 succeeded
Details
microsoft.LLVMSharp (macos_release_x64) macos_release_x64 succeeded
Details
microsoft.LLVMSharp (ubuntu_debug_x64) ubuntu_debug_x64 succeeded
Details
microsoft.LLVMSharp (ubuntu_release_x64) ubuntu_release_x64 succeeded
Details
microsoft.LLVMSharp (windows_debug_x64) windows_debug_x64 succeeded
Details
microsoft.LLVMSharp (windows_debug_x86) windows_debug_x86 succeeded
Details
microsoft.LLVMSharp (windows_release_x64) windows_release_x64 succeeded
Details
microsoft.LLVMSharp (windows_release_x86) windows_release_x86 succeeded
Details
@tannergooding

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.