-
Notifications
You must be signed in to change notification settings - Fork 95
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
Question: Migrating to OOP - DIBuilder #124
Comments
Not currently. There are a number of the "raw" APIs that don't have the minimal wrapper bindings yet. If they existed they would be defined here: https://github.com/microsoft/LLVMSharp/blob/master/sources/LLVMSharp/Interop.Extensions/LLVMDIBuilderRef.cs PRs are more than welcome if you would like to try adding them. Otherwise, I should (hopefully) be getting to it sometime this month. |
Sure, I can do a PR for the ones I create. Any idea how I should create the |
For ClangSharp, I had been returning or taking You can see https://github.com/microsoft/ClangSharp/blob/ff9e62f98b047d7f2142c807be6be548afcd74e6/sources/ClangSharp/Interop.Extensions/CXCursor.cs#L168, https://github.com/microsoft/ClangSharp/blob/2321198c105452a52275a452e0e91c3d65bf4574/sources/ClangSharp/Interop.Extensions/CXTranslationUnit.cs#L221, and https://github.com/microsoft/ClangSharp/blob/2321198c105452a52275a452e0e91c3d65bf4574/sources/ClangSharp/Interop.Extensions/CXTranslationUnit.cs#L115 for examples. So, [DllImport(LibraryPath, CallingConvention = CallingConvention.Cdecl, EntryPoint = "LLVMDIBuilderCreateSubroutineType", ExactSpelling = true)]
[return: NativeTypeName("LLVMMetadataRef")]
public static extern LLVMOpaqueMetadata* DIBuilderCreateSubroutineType([NativeTypeName("LLVMDIBuilderRef")] LLVMOpaqueDIBuilder* Builder, [NativeTypeName("LLVMMetadataRef")] LLVMOpaqueMetadata* File, [NativeTypeName("LLVMMetadataRef *")] LLVMOpaqueMetadata** ParameterTypes, [NativeTypeName("unsigned int")] uint NumParameterTypes, LLVMDIFlags Flags); would be something like: public LLVMMetadataRef CreateSubroutineType(LLVMMetadataRef File, ReadOnlySpan<LLVMMetadataRef> ParameterTypes, LLVMDIFlags Flags)
{
fixed (LLVMMetadataRef* pParameterTypes = ParameterTypes)
{
LLVM.DIBuilderCreateSubroutineType(this, File, (LLVMOpaqueMetadata**)pParameterTypes, (uint)ParameterTypes.Length, Flags);
}
} |
Thanks, I'm sure I'll have more questions, but can take them up in the PR. |
Are there OOP equivalents for the DIBuilder funcitons, .e.g.
LLVMCreateDIBuilder
,LLVMDIBuilderCreateCompileUnit
,LLVMDIBuilderCreateFile
,LLVMDIBuilderCreateDebugLocation
?The text was updated successfully, but these errors were encountered: