Thanks for the reply john. What I want is something like the _global qualifier of opencl. The hardware architecture that I am trying to support with clang has this global address space. I am not sure about how to add an address space qualifier and parse and generate IR all the way. <br>
I looked into the embedded C "address space" type qualifier, Can an expert who is familiar with openCL, tell me if this could be changed to act like the _global type qualifier. If not, I can use some suggestions too.<br>
<br>The following link was posted in march about the address space qualifiers, I would like to know if there was any progress on this topic. <br><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-March/008252.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-March/008252.html</a> <br>
<br>Thanks a lot.<br><br><div class="gmail_quote">On Mon, May 10, 2010 at 4:28 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On May 10, 2010, at 11:50 AM, kalyan ponnala wrote:<br>
> I am trying to add a new qualifier to the existing clang architecture. So far I was looking into replacing one of the existing qualifiers "volatile or restrict" from the "fast qualifiers". Now I think its a bad idea to do that. Can someone tell me<br>

><br>
> >> whats the best way to add a new type quailfier?<br>
<br>
</div>The first question you should ask yourself is whether this is really a qualifier.  Does it need to apply to arbitrary types?  Is it more appropriately modeled as an attribute on specific type declarations, or possibly an independent type kind?  Does it behave like a normal C qualifier, e.g. it is lost during r-value conversion?<br>

<br>
Assuming that's true, read on.<br>
<div class="im"><br>
> >> Why are there only 3 fast qualifiers added to the qualtype?<br>
<br>
</div>The fast qualifiers are mangled into the low bits of the type pointer;  that's why they're fast, because they don't need to be stored separately.  Other qualifiers are stored in a separately-allocated ExtQuals structure.<br>

<br>
If we allocate Types with 8-byte alignment, we have three bits available.  Currently only const and restrict are fast, and the third bit is used to indicate that the type has extended qualifiers.<br>
<div class="im"><br>
> >> How can I increase the size of the fast qualifiers, I mean how to add new qualifier to qualtype without actually disturbing the existing fast quals : const, volatile, restrict.<br>
<br>
<br>
</div>I would strongly suggest that you avoid changing the fast-qualifiers representation.  Just add your new qualifier to the Qualifiers structure and make sure the Profile method includes it, and then you'll just need to worry about the N places in the code which assume they know about every qualifier (I consider such code to be buggy, but surprisingly that judgement doesn't by itself fix any bugs :) ).<br>

<font color="#888888"><br>
John.</font></blockquote></div><br><br clear="all"><br>-- <br>Kalyan Ponnala<br>phone: 8163772059<br>
<div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>