[cfe-users] How to compile .cpp file into LLVM IR with LLVM API?

Anton Smirnov dev at antonsmirnov.name
Tue Jun 24 00:08:11 PDT 2014


Hi, all.

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 clang or ld) are allowed. I
believe ld is not needed as i'm not going to link the files.

Actually what i need is to do clang -S -emit-llvm main.cpp but using
LLVM/Clang API.
Regards, Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20140624/5212a2f6/attachment.html>


More information about the cfe-users mailing list