[LLVMdev] Name of Function's original module during link-time optimization

Bram Adams bram.adams at ugent.be
Mon Sep 25 05:24:50 PDT 2006


Reid Spencer wrote:
> Call getBytecodeModuleProvider (see Reader.h).
The problem is that one needs to provide the filename of the original 
module as the argument of getBytecodeModuleProvider, whereas this is 
unknown (it's exactly what we're trying to find out).

But, by looking where this method is called in the original bytecode 
loading process, I figured out a way to set the attribute I added when 
all Functions of a Module are linked into the sole link-time Module (see 
patch). The reason I pass an extra argument to so many methods (I let it 
default to ""), is that I'd like to have a full path name, not only the 
specific file name, of the original modules. As such, using 
someFunction->getParent()->getModuleIdentifier() in 
lib/Linker/LinkModules.cpp:650 did not suffice. However, I noticed that 
File.toString() in lib/Linker/LinkItems.cpp:150 does not yield the full 
path name.

Could this patch (in a revised form) be added to LLVM?

Kind regards,

Bram Adams
GH-SEL, INTEC, Ghent University (Belgium)

>  This will return a
> ModuleProvider. Ask it for the Module and then ask the Module for its
> identifier. This approach avoids loading all the functions. 
> Reid.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.modulename-1.8
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060925/2a6a42ea/attachment.ksh>

More information about the llvm-dev mailing list