Changes between Version 2 and Version 3 of PointsToAnalysis


Ignore:
Timestamp:
02/15/16 14:58:37 (10 years ago)
Author:
zmanchun
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PointsToAnalysis

    v2 v3  
    4040      `obj(ea[ei])={ea[ei]}`
    4141
    42 ==== Sub-expressions ====
    43 let `e` be an expression, let `sub(e)` be the set of sub-expressions of `e`.
     42==== Questions ====
     431. how about arrays of pointers:
     44    e.g., for `int* a[10];`, we'll need to have one set for each array element.\\
     45    how do you deal with:
     46    {{{
     47    int *a[10], b[10];
    4448
    45 1. abstract function call: `f(e0,e1, ...)`
    46     `sub(f(e0,e1, ...)) = {e0, e1, ...}`
    47 2. address-of: `&le`
    48     `sub(&le)={le} U sub(le)`
    49 3. array literal: `{e0, e1, ...}`
    50     `sub({e0, e1, ...}) = {e0, e1, ...}``
    51  4. binary expression: `e0 op e1`
    52     `sub(e0 op e1) = e0.type== pointer ? {e1} : {e0, e1}`
    53 5. bound variable expression: `eb`
    54     `sub(eb)=\empty`
    55 6. cast expression: `(T)e`
    56     `sub((T)e)={e}`
     49    for(int i=0; i<10; i++){
     50      a[i]=b[i];
     51    }
     52    }}}
     53    A precise analysis should say that:
     54   `obj(a[0])={b[0]}`\\
     55   `obj(a[1])={b[1]}`\\
     56   ...\\
     57   but a less-precise analysis could say that:
     58   `obj(a[0])={b[0], b[1], ...}`\\
     59   `obj(a[1])={b[0], b[1], ...}`\\
     60   ...
     61
     62   A more intersting example:
     63   {{{
     64   $parfor(int i: 0 .. 9){
     65      a[i]=b[i];
     66   }
     67   }}}
     68   
    5769
    5870
    5971
    6072
    61 
    62