3 ms·
I think easiest way is just to write a backend that emits .NET IR since infra is already there.
by flamedoge 8y ago
I think easiest way is just to write a backend that emits .NET IR since infra is already there.
- daeken 8y agoThere are four ways I considered for implementing this: write an LLVM backend that spits out .NET binaries; write an LLVM backend that spits out C# or CIL assembly; read the LLVM bytecode from .NET and then generate code from there; use the LLVM API to generate some intermediary then handle the compilation from .NET. I tried #3 first, but landed on #4 in the interest of time. It's not the cleanest approach -- that'd be either using the LLVM API from .NET or implementing a proper backend (assuming there's some decent implementation of a .NET binary writer, since that's a mess) -- but it's stupid simple and effective.
- lostmsu 8y agoThere is one, actually: https://github.com/UbiquityDotNET/Llvm.NET https://github.com/UbiquityDotNET/Llvm.NET