<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 5, 2008, at 6:12 PM, Zhongxing Xu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-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; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br class="Apple-interchange-newline">On Thu, Nov 6, 2008 at 9:33 AM, Ted Kremenek<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; "><div><br><div><div class="Ih2E3d"><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-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 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><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></body></html>