Hi, if one has a Value object, the Type of the Value can be retrieved with getType(). Is there a way back, get a list of all values that refer to a specific type (i.e. a struct etc.)? Regards, Gerion
The Value naturally has corresponding Type. But I don't know existing interface for the other way around. 2017-11-24 23:06 GMT+08:00 Gerion Entrup via llvm-dev < llvm-dev at lists.llvm.org>:> Hi, > > if one has a Value object, the Type of the Value can be retrieved with > getType(). > Is there a way back, get a list of all values that refer to a specific > type (i.e. a struct etc.)? > > Regards, > Gerion > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171125/37df4472/attachment.html>
What would "all" values be here? All values in the Module? Function? BasicBlock? Program? There is no builtin way to do this. You need to enumerate the values you care about and check their type. Either way this sounds like a weird thing to do. What is it that you are actually intending? Cheers, Philip 2017-11-24 16:06 GMT+01:00 Gerion Entrup via llvm-dev < llvm-dev at lists.llvm.org>:> Hi, > > if one has a Value object, the Type of the Value can be retrieved with > getType(). > Is there a way back, get a list of all values that refer to a specific > type (i.e. a struct etc.)? > > Regards, > Gerion > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171127/73c8110e/attachment-0001.html>
Hi, I'm trying to build an explicit graph out of the LLVM structures and try to do this in a bidirectional way. All values means all values in the Module. Anyway, if there is no direct way, I need to circumvent it someway. Thanks for your answers. Gerion Am Montag, 27. November 2017, 12:52:04 CET schrieben Sie:> What would "all" values be here? All values in the Module? Function? > BasicBlock? Program? > > There is no builtin way to do this. You need to enumerate the values you > care about and check their type. > > Either way this sounds like a weird thing to do. What is it that you are > actually intending? > > Cheers, > Philip > > 2017-11-24 16:06 GMT+01:00 Gerion Entrup via llvm-dev < > llvm-dev at lists.llvm.org>: > > > Hi, > > > > if one has a Value object, the Type of the Value can be retrieved with > > getType(). > > Is there a way back, get a list of all values that refer to a specific > > type (i.e. a struct etc.)? > > > > Regards, > > Gerion > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > >