<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">Thanks.<VAR id=yui-ie-cursor></VAR></SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 13px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2>This file was very much useful. </FONT></SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 13px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2>I could get the required information by referencing contents from this file.</FONT></SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 13px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2></FONT></SPAN> </div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 2px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2>Thanks & Regards,</FONT></SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 2px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2>Pankaj</FONT></SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 2px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2></FONT></SPAN> </div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 2px; RIGHT: auto"><SPAN style="RIGHT: auto"><FONT size=2></FONT></SPAN> </div>
<div><BR></div>
<DIV style="FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; FONT-SIZE: 10pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV dir=ltr><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Duncan Sands <baldrick@free.fr><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> llvmdev@cs.uiuc.edu <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Saturday, September 22, 2012 8:28 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [LLVMdev] Typedef struct types<BR></FONT></DIV><BR>Hi Pankaj, you may find include/llvm/TypeFinder.h useful.<BR><BR>Ciao, Duncan.<BR><BR>On 22/09/12 16:26, Pankaj Gode wrote:<BR>> Hi All,<BR>> I was searching for, extracting information about 'typedefed struct types' from<BR>> 'module'.<BR>> I have 'struct'
typedefed in a .h file. I try to use this structure instance<BR>> inside a function.<BR>> My .ll file rightly defines this type in the beginning so that it can be used<BR>> later. (for example below)<BR>> %struct.DEBLOCK_UNIT = type { i8*, i8*, i8*, i8, i32, i32,<BR>> %struct.DEBLOCK_UNIT*, %struct.DEBLOCK_UNIT*, %struct.DEBLOCK_UNIT* }<BR>> .....<BR>> define void @DeblockAreaFetch(i8* %SrcY, i8* %SrcU, i8* %SrcV, i32 %FrameWidth,<BR>> %struct.DEBLOCK_UNIT* nocapture %DeblockUnit, i32 %TransferWidth) nounwind {<BR>> entry:<BR>> }<BR>> How to I get information about "%struct.DEBLOCK_UNIT" from the 'Module' of this<BR>> file ?<BR>> The approach I tried was to iterate through the "global variable list" and<BR>> extract type from there. This works well for below case.<BR>> %struct._D_ChannelReg = type { %struct._D_ChannelReg*, i8*, i8*, i32, i32, i32,<BR>> [2 x i32] }<BR>> @gInterPredD = external global
%struct._D_ChannelReg*<BR>> In this case "gInterPredD" is a global variable and hence I easily get<BR>> information about it's type and their element type.<BR>> But for the case, where an instance of this 'typedefed struct' is passed as a<BR>> variable or used inside a function,<BR>> In llvm2.9, we had TypeSymbolTable in module which used to have information<BR>> about all the types explicitly. I think no such information is present from<BR>> llvm3.0 onwards due to type system change.<BR>> So, is it the case that I have to get the type information as and when I<BR>> encounter any variable which is of type 'typedefed struct' only ?<BR>> Thanks & Regards,<BR>> Pankaj<BR>><BR>><BR>> _______________________________________________<BR>> LLVM Developers mailing list<BR>> <A href="mailto:LLVMdev@cs.uiuc.edu" ymailto="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A>
http://llvm.cs.uiuc.edu<BR>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<BR>><BR><BR>_______________________________________________<BR>LLVM Developers mailing list<BR><A href="mailto:LLVMdev@cs.uiuc.edu" ymailto="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A> <A href="http://llvm.cs.uiuc.edu/" target=_blank>http://llvm.cs.uiuc.edu/</A><BR><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target=_blank>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A><BR><BR><BR></DIV></DIV></div></body></html>