<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-composition-fill-color: rgba(175, 192, 227, 0.231373); -webkit-composition-frame-color: rgba(77, 128, 180, 0.231373); ">On Nov 5, 2008, at 6:27 PM, Zhongxing Xu <<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>> wrote:</span><br></div><div><br></div><div></div><blockquote type="cite"><div><br><br><div class="gmail_quote">On Thu, Nov 6, 2008 at 10:20 AM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com"><a href="mailto:kremenek@apple.com">kremenek@apple.com</a></a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><br><div><div class="Ih2E3d"><div>On Nov 5, 2008, at 6:12 PM, Zhongxing Xu wrote:</div><br></div><div class="Ih2E3d"><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br>
On Thu, Nov 6, 2008 at 9:33 AM, Ted Kremenek<span> </span><span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank"><a href="mailto:kremenek@apple.com">kremenek@apple.com</a></a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br><div><div><div>On Nov 5, 2008, at 5:24 PM, Zhongxing Xu wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thoughts?<br><font color="#888888"><br>Ted</font></blockquote><div><br>Sounds reasonable! I remember that there was RegionExtent code. Maybe we should pick it up.<span> </span></div></span></blockquote><div><br></div></div>
<div>Right; I scribbled some code for that, but never really implemented anything real.  I think we just need to establish a "taxonomy" of extents/sizes, and decide if we need a variant like RegionExtent or can just use SVals.</div>
</div></div></blockquote><div><br>I think we can use SVals for now and extend to a RegionExtent class when necessary.<br><br>Another thing to discuss: what units shall we choose for representing extent? In bits, bytes, or element numbers? For array bounds checking, element numbers are the most direct. What other clients care about the extents?</div>
</span></blockquote></div></div><div><br></div><div>Bits, bytes, number of elements... these are each different abstractions of memory, and different clients will have separate needs.  If we provide a clean interface to go between these units (which could potentially be provided by a RegionExtent class) then I think we (a) can serve more clients more easily and (b) have extra error checking for cases when clients use the wrong units.</div>
<br><div>Here's one argument for bits.  That's what ASTContext::getTypeSize() and ASTContext::getTypeAlign() return (so there is some consistency there).  Moreover, it is plausible that we have regions over individual bits (e.g., bit fields, bit-level typing).  As long as its consistent I think we're fine.</div>
</div></blockquote></div><br>Yeah. We can represent in bits internally in RegionExtent and provide interface for RegionExtent to convert to bytes or other units.<br>
</div></blockquote><br><div>My thoughts exactly.</div></body></html>