[cfe-dev] Lazy bindings
Zhongxing Xu
xuzhongxing at gmail.com
Sun Dec 14 02:15:20 PST 2008
Sorry, this email is unfinished. I accidentally clicked 'send' button.
On Sun, Dec 14, 2008 at 6:13 PM, Zhongxing Xu <xuzhongxing at gmail.com> wrote:
> In current static analysis implementation, big array initializations takes
> a very long time, because we create regions for every elements no matter if
> it is used at all. Lazy binding is desirable for such cases. That is, when
> the decl stmt is visited, only a VarRegion is created for the array.
> ElementRegions will be created when it is first time read or written.
>
> We have to distinguish the following cases if a region is not in
> regionbindings:
> * it is assigned unknown value (a.k.a. killed, we remove its binding in
> such case)
> * it is not initialized and it is local, we should return undefined value
> for it
> * it is not initialized and it is global, we should return symbolic value
> for it
>
> A tentative logic is proposed as follows:
>
> Retrieve(Loc L)
> if L is in bindings
> return bind(L)
> else
> if L is not field or element
> return UnknownVal // we initialize scalar variable, so
> it must be killed.
> else
> if L is in killset
> return UnknownVal
> else
> if L is on the stack or heap
> return UndefinedVal
> else
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081214/93950072/attachment.html>
More information about the cfe-dev
mailing list