[cfe-dev] how to generate IR file when linking

James Molloy james at jamesmolloy.co.uk
Mon Aug 10 23:01:10 PDT 2015


Hi,

Where you normally would add '-c' to the clang argument list to generate an
object, instead add '-S -emit-llvm '. That will generate you a textual IR
file that you can inspect.

Cheers,

James
On Tue, 11 Aug 2015 at 05:28, 修心 <haifeng_q at foxmail.com> wrote:

> HI!
>
>     How the generated LLVM IR with clang?
>     Want to learn By IR files how to use the external Library type ?
>
>     My code:
>
> #include <string>
> #include <iostream>
>
>
> int main(int argc, char* argv[])
> {
> std::wstring strOut = L"error msg!";
> std::wcout << strOut << std::endl;
>
> return 0;
> }
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150811/857c2a6a/attachment.html>


More information about the cfe-dev mailing list