Getting module name for printing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting module name for printing

Surinder J
Hi,
 
I want to modify the module printing acheived by -print-module option on opt.  I want to print module name and functions ina different format for dumping on a file and then reading by a Haskell program.  My question is :
 
How do I get module name from &M.  I have tried M.getName() only to find out that there is no such method defined in Module.cpp
 
I intend to modify or copy runOnModule in PrintModulePass.cpp for my research.
 
Surinder

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Getting module name for printing

Chris Lattner

On Dec 23, 2010, at 4:48 PM, Surinder J wrote:

> Hi,
>  
> I want to modify the module printing acheived by -print-module option on opt.  I want to print module name and functions ina different format for dumping on a file and then reading by a Haskell program.  My question is :
>  
> How do I get module name from &M.  I have tried M.getName() only to find out that there is no such method defined in Module.cpp
>  
> I intend to modify or copy runOnModule in PrintModulePass.cpp for my research.
>  

It looks like Module::getModuleIdentifier()  is the method you're looking for.

FYI, for questions about llvm::* stuff, it's best to ask on llvmdev instead of cfe-dev.

-Chris


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev