Hi, I am new with the llvm infrastructure and I am trying to write a Pass that prints the mapping between IR variable names and the names of the variables in the source code.As I can see from the generated IR .s files of simple programs variables preserve the same name. If it is not always the case that names are preserved, there is a way during the execution of a Pass to access a table with the mapping between the names?I think maybe the right table that I should try to access is the IdentifierTable but I do not find a way to get inside a Pass. Any suggestion or example will be really appreciated.Thank you in advance,Niko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130219/19e1f4c0/attachment.html>
On Tuesday, February 19, 2013, Niko Zarzani wrote:> Hi, I am new with the llvm infrastructure and I am trying to write a Pass that prints the mapping between IR variable names and the names of the variables in the source code. > > It is not possible to easily do this. Names for values in LLVM code arearbitrary. The best one can do is to parse the debug info. Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130219/1a3c0766/attachment.html>