LLVMSharp
LLVMSharp copied to clipboard
LLVM.GetTargetFromTriple in OO api
There does not seem to be an equivalent method in the object oriented api.
Yes I also realized this, this is the only way I could make it work:
unsafe
{
fixed (byte* ptr = Encoding.ASCII.GetBytes("data-layout"))
LLVM.SetDataLayout(Module, (sbyte*)ptr);
fixed (byte* ptr = Encoding.ASCII.GetBytes("target"))
LLVM.SetTarget(Module, (sbyte*)ptr);
}
Unsafe, but works.
Also GetBitcodeModule functions seem to be not ported to object orinted API either.
Yes I also realized this, this is the only way I could make it work:
unsafe { fixed (byte* ptr = Encoding.ASCII.GetBytes("data-layout")) LLVM.SetDataLayout(Module, (sbyte*)ptr); fixed (byte* ptr = Encoding.ASCII.GetBytes("target")) LLVM.SetTarget(Module, (sbyte*)ptr); }Unsafe, but works. Also
GetBitcodeModulefunctions seem to be not ported to object orinted API either.
Thanks a lot. I have been looking for a workaround for weeks now. 😃
Yeah, no problem 😉. I want create a new pull request for these missing methods but I need to research the code structure more.
Edit: Probably related #141 (?)
The nicer managed wrapper tries to mirror the C++ API structure where possible, there are naturally chunks missing and so not everything can be mirrored perfectly.