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

Chris Lattner sabre at nondot.org
Mon Sep 25 11:07:37 PDT 2006


On Mon, 25 Sep 2006, Bram Adams wrote:
> 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?

What are you trying to accomplish?  Why not use location records from 
debug info?

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list