[cfe-dev] how to generate both IR and object file

Nikola Smiljanic popizdeh at gmail.com
Mon Jun 23 17:25:52 PDT 2014


This reminds me of another recent question where someone wanted to run both
compile and analyze actions. Is there anything that actually prevents us
from running multiple actions?


On Sun, Jun 22, 2014 at 7:22 PM, Alp Toker <alp at nuanti.com> wrote:

>
> On 19/06/2014 23:38, Jinwook Shin wrote:
>
>> Hi,
>>
>> I use the -emit-llvm flag to generate IR files and use LTO to link them
>> together to produce the final executable. Sometimes LTO gives me link-time
>> errors, so I want to avoid using it, yet I need IR files.
>>
>> Question: Is there a way to instruct clang to generate *both* an IR file
>> and a regular object file at compile-time, and during the link time, use
>> the object files only, while leaving out the IR files?
>>
>
> That isn't supported by the standard driver and frontend but it's a
> perfectly reasonable feature to request.
>
> It's missing mostly for historical reasons -- the frontend action pipeline
> wasn't designed to be composable, meaning you can only do one thing per
> invocation.
>
> The limitation doesn't apply if you use the clang C++ API to build a
> custom tool.
>
> Alp.
>
>
>
>
>> Thanks,
>> JS
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
> --
> http://www.nuanti.com
> the browser experts
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140624/fb856c0f/attachment.html>


More information about the cfe-dev mailing list