<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
I'd really be interested in getting full support for this. <br>
We're doing abstract interpretation on c++  code (lowered to c code via
llvm).  <br>
I restrained from adding a direct mapping from type to type name
because it appears to be somewhat <br>
involved (having to change the IT etc) but it would be very helpful for
us to have this.<br>
<br>
Alex<br>
<br>
P.S.: To Devang : I'll submit the other patch for debug info asap..I
just didn't have the time yet..<br>
<br>
<br>
<br>
On 09/30/2010 07:28 PM, Pekka Nikander wrote:
<blockquote
 cite="mid:61338E71-8F4C-4496-8456-04B8EB6DDFFE@nomadiclab.com"
 type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">We want to avoid any Type class modification. Instead you can use pair in named metadata to match metadata with type.

          </pre>
        </blockquote>
      </blockquote>
      <pre wrap="">
I thought about that more, and I think the "right" way would be to have a syntax like

!21 = metadata !{ type %struct.T, metadata !11 } 

or perhaps

!21 = metadata !{ typeval %struct.T, metadata !11 }

to avoid the problem with the keyword 'type'.

Would that be worth doing?  Apparently we can fake with our need, and use a null pointer instead.  Technically, that would be wrong, but would work with the current code without any modifications:

!21 = metadata !{ %struct.T *null, metadata !11 }
      </pre>
    </blockquote>
    <pre wrap="">
I would recommend this approach.
    </pre>
  </blockquote>
  <pre wrap="">
But that would have a hacky feeling :-)

Anyway, I already implemented an early patch for making Types representable as Values.  For that I created a new class, TypeValue, which represents a type as a value.  An early patch for that enclosed.  Works when reading or writing textual representations; no BC representation yet.  And no test case yet.  

This works well enough for our purposes; I don't have any incentive to go further unless someone else needs a similar kind of functionality.

--Pekka

  </pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
  </pre>
</blockquote>
<br>
</body>
</html>