Merging Modules

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Merging Modules

Redmond, Paul

Hi,

 

Can anyone point me to some code (or offer advice) on how I can merge one Module into another?

 

I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified)

 

Thanks,

paul


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Merging Modules

Devang Patel
<base href="x-msg://400/">Hi Paul,

On Sep 8, 2011, at 10:52 AM, Redmond, Paul wrote:

Hi,
 
Can anyone point me to some code (or offer advice) on how I can merge one Module into another?
 
I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified)


See Linker::LinkModules(..).
-
Devang


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Merging Modules

Nick Lewycky-2
On 8 September 2011 10:57, Devang Patel <[hidden email]> wrote:
Hi Paul,

On Sep 8, 2011, at 10:52 AM, Redmond, Paul wrote:

Hi,
 
Can anyone point me to some code (or offer advice) on how I can merge one Module into another?
 
I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified)


See Linker::LinkModules(..).

Mm, I think LinkModules is destructive to one of its input modules. Try CloneFunction http://llvm.org/doxygen/namespacellvm.html#aabb040f50a7e75ad8d58bfc5d95636a4 maybe?
 
-
Devang


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Merging Modules

Redmond, Paul

Thanks for the advice. Using Linker and CloneModule seems to suit my needs perfectly.

 

From: Nick Lewycky [mailto:[hidden email]]
Sent: Thursday, September 08, 2011 2:45 PM
To: Devang Patel
Cc: Redmond, Paul; [hidden email]
Subject: Re: [LLVMdev] Merging Modules

 

On 8 September 2011 10:57, Devang Patel <[hidden email]> wrote:

Hi Paul,

 

On Sep 8, 2011, at 10:52 AM, Redmond, Paul wrote:



Hi,

 

Can anyone point me to some code (or offer advice) on how I can merge one Module into another?

 

I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified)

 

 

See Linker::LinkModules(..).

 

Mm, I think LinkModules is destructive to one of its input modules. Try CloneFunction http://llvm.org/doxygen/namespacellvm.html#aabb040f50a7e75ad8d58bfc5d95636a4 maybe?

 

-

Devang

 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev