<br><br><div class="gmail_quote">On Sun, Oct 26, 2008 at 3:47 AM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</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 class="Ih2E3d"><br>
On Oct 25, 2008, at 7:13 AM, Zhongxing Xu wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/// AnonTypedRegion - An "anonymous" region that simply types a chunk<br>
///  of memory.<br>
class AnonTypedRegion : public TypedRegion {<br>
@@ -195,6 +227,11 @@<br>
public:<br>
  const Decl* getDecl() const { return D; }<br>
  void Profile(llvm::FoldingSetNodeID& ID) const;<br>
+<br>
+  static bool classof(const MemRegion* R) {<br>
+    unsigned k = R->getKind();<br>
+    return k > BEG_DECL_REGIONS && k < END_DECL_REGIONS;<br>
+  }<br>
};<br>
</blockquote>
<br></div>
Hi Zhongxing,<br>
<br>
Can you tell me what your motivation was for implementing 'classof' for AnonTypedRegion in this way?  This will return true if the MemRegion is a VarRegion or a FieldRegion, but not if it is an instance of AnonTypedRegion (!).  AnonTypedRegion is just meant to be some lightweight layering on top of an existing region where we want to add some typing information to a set of bytes.<br>
<font color="#888888">
</font></blockquote><div><br>Hi Ted,<br><br>This is not the classof implementation of AnonTypedRegion, but of DeclRegion. It looks confusing in the patch. Please look at the updated MemRegion.h.<br></div></div><br>