[llvm-dev] Parse LLVM IR using LLVM C API

Nicholas Wilson via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 8 13:09:23 PST 2017


We have this feature for LDC the LLVM D Compiler[1] (although we use the C++ API).
This is the relevant code: https://github.com/ldc-developers/ldc/blob/master/gen/inlineir.cpp

Nic

[1]:https://github.com/ldc-developers/ldc/

On 8 Dec 2017, at 11:53 pm, Mahdi Mohammadi via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:

Hi,

I'm writing a compiler and I am thinking of mixing LLVM IR inside the source code I'm compiling. So user can write normal code and write some functions using LLVM IR.

Is it possible to use LLVM C API to parse those sections of the source code and convert them into `LLVMValueRef`s pointing to parsed functions?

Thanks,
Mahdi
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171208/0f238148/attachment.html>


More information about the llvm-dev mailing list