<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
We have this feature for LDC the LLVM D Compiler[1] (although we use the C++ API).
<div class="">This is the relevant code: <a href="https://github.com/ldc-developers/ldc/blob/master/gen/inlineir.cpp" class="">
https://github.com/ldc-developers/ldc/blob/master/gen/inlineir.cpp</a> <br class="">
<div class=""><br class="">
</div>
<div class="">Nic</div>
<div class=""><br class="">
</div>
<div class="">[1]:<a href="https://github.com/ldc-developers/ldc/" class="">https://github.com/ldc-developers/ldc/</a></div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 8 Dec 2017, at 11:53 pm, Mahdi Mohammadi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi,</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">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.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">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?</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks,</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Mahdi</div>
</div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>