Hi I am trying to count the no of datastructures and the type, say for example the number of arrays in a given code. Which pass would give me this info? And what do I need to use in it? Thanks for the help Cheers Nipun :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081031/ffceddee/attachment.html>
Hi Nipun, On Oct 30, 2008, at 9:31 PM, Nipun Arora wrote:> Hi > > I am trying to count the no of datastructures and the type, say for > example the number of arrays in a given code. Which pass would give > me this info? And what do I need to use in it?What are you trying to achieve here with this information ? You can iterate over types to collect the info you need. For example, TypeSymbolTable &TST = MyModule.getTypeSymbolTable(); for(TypeSymbolTable::iterator TI = TST.begin(), TE =TST.end(); TI != TE; ++TI) { const Type *Ty = TI->second; ... } http://llvm.org/docs/ProgrammersManual.html is very useful document for beginners.> > Thanks for the help > > Cheers > Nipun :) > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev- Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081031/8f3d2ff8/attachment.html>
Hey Devang, Thanks for the assist, I'm trying to extract a signature which uniquely identifies a block of code.... this is required for a project I am doing. The no of data structures is one of the identifying features of this signature. Thanks Nipun On Fri, Oct 31, 2008 at 1:05 PM, Devang Patel <dpatel at apple.com> wrote:> Hi Nipun, > On Oct 30, 2008, at 9:31 PM, Nipun Arora wrote: > > Hi > I am trying to count the no of datastructures and the type, say for example > the number of arrays in a given code. Which pass would give me this info? > And what do I need to use in it? > > > What are you trying to achieve here with this information ? > > You can iterate over types to collect the info you need. For example, > > TypeSymbolTable &TST = MyModule.getTypeSymbolTable(); > for(TypeSymbolTable::iterator TI = TST.begin(), TE =TST.end(); TI != TE; > ++TI) { > const Type *Ty = TI->second; > ... > } > > http://llvm.org/docs/ProgrammersManual.html is very useful document for > beginners. > > > Thanks for the help > > Cheers > Nipun :) > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > - > Devang > > > > > _______________________________________________ > 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 HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081102/b7ccb489/attachment.html>
Hi I was having just one more problem. I would like to find these datastructures/ primitive types etc inside a block, however the valuesymbol table is available only at a functional level. What can I do so as to get the number + type of datastructs(eg. arrays etc) inside a single block? Thanks Nipun On Fri, Oct 31, 2008 at 12:05 PM, Devang Patel <dpatel at apple.com> wrote:> Hi Nipun, > On Oct 30, 2008, at 9:31 PM, Nipun Arora wrote: > > Hi > I am trying to count the no of datastructures and the type, say for example > the number of arrays in a given code. Which pass would give me this info? > And what do I need to use in it? > > > What are you trying to achieve here with this information ? > > You can iterate over types to collect the info you need. For example, > > TypeSymbolTable &TST = MyModule.getTypeSymbolTable(); > for(TypeSymbolTable::iterator TI = TST.begin(), TE =TST.end(); TI != TE; > ++TI) { > const Type *Ty = TI->second; > ... > } > > http://llvm.org/docs/ProgrammersManual.html is very useful document for > beginners. > > > Thanks for the help > > Cheers > Nipun :) > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > - > Devang > > > > > _______________________________________________ > 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 HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081104/8f28fcdc/attachment.html>