<br><br><div class="gmail_quote">On Thu, Dec 18, 2008 at 9:53 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">On Dec 17, 2008, at 4:22 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;">
Hi Ted,<br>
<br>
This is the patch for lazy binding.<br>
</blockquote>
<br></div>
Hi Zhongxing,<br>
<br>
This is a huge patch, so I'm going to make a few passes over it.  Overall it looks very good.  I'm wondering if we can break out the changes to SymbolManager.[h,cpp] into a separate patch without compromising the current functionality of BasicStore.  It would also make your changes to RegionStore more isolated.</blockquote>
<div><br>OK. I'll try to break it into some separate patches.<br> </div><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>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
* failed C test cases are due to bugs in RemoveDeadBindings(),<br>
which removes constraints that is still alive. I plan to fix this<br>
in a later patch. This patch is already messy enough.<br>
</blockquote>
<br></div>
Okay.<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
* I wish you could help fix failed ObjC test cases, since I have<br>
no access to the Mac development platform. It'll take some time for me<br>
to learn basic things.<br>
</blockquote>
<br></div>
Sure thing.<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
* default value of array and struct regions are not implemented<br>
yet, because the GDM of the same type of ImmutableMap<const<br>
Region*, SVal> is already used for region extents.<br>
</blockquote>
<br></div>
You can have multiple GDM entries of the same type.  Just use a different GDM index and create a different "tag" type.  For example, I *believe* that the following should do the trick (this shows two GDM entries with the same map type):<br>

<br>
typedef llvm::ImmutableMap<SymbolRef, unsigned> MapTy;<br>
<br>
// TypeA.<br>
class TypeA {};<br>
static int TypeAIndex = 0;<br>
<br>
namespace clang {<br>
  template<><br>
  struct GRStateTrait<TypeA> : public GRStatePartialTrait< MapTy > {<br>
    static inline void* GDMIndex() { return &TypeAIndex; }<br>
  };<br>
}<br>
<br>
// TypeB.<br>
static int TypeBIndex = 0;<br>
<br>
namespace clang {<br>
  template<><br>
  struct GRStateTrait<TypeB> : public GRStatePartialTrait< MapTy > {<br>
    static inline void* GDMIndex() { return &TypeBIndex; }<br>
  };<br>
}<br>
<br>
I think this should work.  Basically the type used for GRStateTrait used for indexing into the GDM table, and we can subclass GRStatePartialTrait to create the rest of the methods.<br>
<br>
All of the other uses of the GDM should probably be modified to follow this style to avoid any accidental re-uses of the same GDM entries.</blockquote><div><br>Thanks! This should work. But I prefer to do it in a later patch.<br>
 </div><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>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
* Now Bind() methods take and return GRState* because binding could<br>
  also alter GDM.<br>
</blockquote>
<br></div>
Makes sense.<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
* No variables are initialized except those declared with initial<br>
  values.<br>
</blockquote>
<br>
<br></div>
Great.<br>
</blockquote></div><br>