[LLVMdev] [cfe-dev] Compiling Multiple Files

Ryan Taylor ryta1203 at gmail.com
Mon Mar 12 11:53:38 PDT 2012


James,

 Thanks. It wouldn't take the LTO option; however, I can get it to inline
using -cppgen=inline.

 However, when I run clang the second time it gives me an error, stating
that it expects a top level entity. I think I've run into this issue
before. Any ideas?

On Mon, Mar 12, 2012 at 11:30 AM, James Molloy <James.Molloy at arm.com> wrote:

> Hi Ryan,
>
> I see. Well, that shouldn't be an issue. If you link the bitcode files
> together with llvm-link you can then do several things:
>
> (1) Run clang on it as you normally would with -O3 for maximum inlining
> (2) Run 'llc' manually with -O3 and LTO, which will do the maximum link
> time optimisations.
> (3) Run 'opt' manually with -O3, LTO which will produce another bitcode
> file, which you can then again give to Clang to codegen.
>
> Cheers,
>
> James
> ________________________________________
> From: Ryan Taylor [ryta1203 at gmail.com]
> Sent: 12 March 2012 18:25
> To: James Molloy
> Cc: llvmdev at cs.uiuc.edu
> Subject: Re: [cfe-dev] Compiling Multiple Files
>
> James,
>
>  Sure. I want to inline functions in a C program that has no external
> node, or "main". So the "top" function is not main and there does not exist
> a main in the file.
>
> Thanks.
>
> On Mon, Mar 12, 2012 at 11:23 AM, James Molloy <James.Molloy at arm.com
> <mailto:James.Molloy at arm.com>> wrote:
> Hi Ryan,
>
> > Do you know if it's possible to inline functions without an external
> node?
>
> Sorry, I don't know to what you're referring here. Could you please
> rephrase? what do you mean be "external node"?
>
> Cheers,
>
> James
> ________________________________________
> From: Ryan Taylor [ryta1203 at gmail.com<mailto:ryta1203 at gmail.com>]
> Sent: 12 March 2012 17:58
> To: James Molloy
> Cc: llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>
> Subject: Re: [cfe-dev] Compiling Multiple Files
>
> I believe it might actually. Do you know if it's possible to inline
> functions without an external node? It doesn't appear to be so.
>
> On Mon, Mar 12, 2012 at 1:24 AM, James Molloy <James.Molloy at arm.com
> <mailto:James.Molloy at arm.com><mailto:James.Molloy at arm.com<mailto:
> James.Molloy at arm.com>>> wrote:
> Hi Ryan,
>
> I would just compile to multiple IR files then link them together with
> llvm-link.
>
> Would that work for you?
>
> Cheers,
>
> James
>
> From: cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu
> ><mailto:cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu>>
> [mailto:cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu
> ><mailto:cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu>>]
> On Behalf Of Ryan Taylor
> Sent: 09 March 2012 19:32
> To: cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu><mailto:
> cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>>
> Subject: [cfe-dev] Compiling Multiple Files
>
> Clangers,
>
>  What's the best way to compile multiple files in one LLVM IR file? It
> doesn't appear that clang supports the gcc -combine feature.
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium.  Thank you.
>
>
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium.  Thank you.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120312/1936f91d/attachment.html>


More information about the llvm-dev mailing list