dotnet / llilc

This repo contains LLILC, an LLVM based compiler for .NET Core. It includes a set of cross-platform .NET code generation tools that enables compilation of MSIL byte code to LLVM supported platforms.
MIT License
1.52k stars 153 forks source link

How to obtain LLVM IR file from MSIL file? #1095

Closed hygeanne closed 2 years ago

hygeanne commented 6 years ago

Hey guys!

I'm trying to find a manual or guide to tell me how I can use LLILC to generate an LLVM IR file from a MSIL file. Is there a way to do this? I'm not even sure how to use LLILC in general, but I really only need LLILC to perform this function and I've not found anything on this yet.

Thanks!

T0bi-Ethirbirge commented 5 years ago

There's nothing called MSIL file because MSIL stands for Microsoft intermediate language which is used to internally represent dotnet compiled method. You can't import a dotnet assembly into LLVM IR, This project uses LLVM as an alternative to RyuJit to benefit from LLVM optimizations.

It is possible to export dotnet compiled method into LLVM IR or even Native compiled code. Maybe I could try doing it.