I tried to get the Type for a global value, but it always returns me a PointerType. This is ok, expect that I want to know what type is being pointed at. How do I do this?
Orgoton Baberek wrote:> I tried to get the Type for a global value, but it always returns me a > PointerType. This is ok, expect that I want to know what type is being pointed > at. How do I do this? >You can utilize the doxygen docs (http://llvm.org/doxygen/hierarchy.html) to find which methods of classes give you the information you want. For example, you can look up the PointerType class and see the methods it provides. One of its methods returns the type it contains (I think it's getContainedType() or something like that; I don't recall the name exactly, but you can use doxygen to find it). -- John T.> _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
John Criswell <criswell <at> uiuc.edu> writes:> You can utilize the doxygen docs > (http://llvm.org/doxygen/hierarchy.html) to find which methods of > classes give you the information you want. > > For example, you can look up the PointerType class and see the methods > it provides. One of its methods returns the type it contains (I think > it's getContainedType() or something like that; I don't recall the name > exactly, but you can use doxygen to find it). >Ohh I didnt know about that hierarchy. I've been looking over the doxygen files but couldnt find the function you mentioned. I did find a "getElementType()" from SequentialType that worked. Thanks a lot!
Apparently Analagous Threads
- [LLVMdev] GlobalValue type
- RFC: PointerType should derive from Type rather than SequentialType
- RFC: PointerType should derive from Type rather than SequentialType
- RFC: PointerType should derive from Type rather than SequentialType
- [LLVMdev] Constant::getAllOnesValue(): expected behaviour or bug?