<div dir="ltr">Hi, all.<div><br></div><div><div class="" itemprop="description" style="margin:0px 5px 5px 0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;word-wrap:break-word;width:660px;line-height:17.804800033569336px;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;background-image:initial;background-repeat:initial">
<p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background:transparent">I'd like to compile source code (.cpp source file) using LLVM classes (not from command-line) into LLVM IR bytecode. How can i do it? I can't create processes so no executable invocations (like <code style="margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap;background:rgb(238,238,238)">clang</code> or <code style="margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap;background:rgb(238,238,238)">ld</code>) are allowed. I believe ld is not needed as i'm not going to link the files.</p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background:transparent">Actually what i need is to do <code style="margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap;background:rgb(238,238,238)">clang -S -emit-llvm main.cpp</code> but using LLVM/Clang API.</p>
</div>Regards, Anton.</div></div>