Skip to content

LLVM.GetTargetFromTriple in OO api #142

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

Open
lukechu10 opened this issue Aug 14, 2020 · 4 comments
Open

LLVM.GetTargetFromTriple in OO api #142

lukechu10 opened this issue Aug 14, 2020 · 4 comments

Comments

@lukechu10
Copy link

There does not seem to be an equivalent method in the object oriented api.

@jangofett4
Copy link

jangofett4 commented Aug 25, 2020

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.

@lukechu10
Copy link
Author

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.

Thanks a lot. I have been looking for a workaround for weeks now. 😃

@jangofett4
Copy link

jangofett4 commented Aug 26, 2020

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 (?)

@tannergooding
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants