<div dir="ltr">
<p class="MsoNormal"><span style="font-size:10pt">Hi all,</span></p><p class="MsoNormal"><span style="font-size:10pt"><br></span></p>
<p class="MsoNormal"><span style="font-size:10pt">I want to get the </span><span style="font-size:10pt;color:black">corresponding</span><span style="font-size:10pt"> MemRegion with a MemberExpr or an ArraySubscriptExpr.</span></p>
<p class="MsoNormal"><span style="font-size:10pt"><br></span></p>
<p class="MsoNormal"><span style="font-size:10pt">For an example:</span></p>
<p class="MsoNormal"><i><span style="font-size:10pt">int arr[10][10][10];</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">arr[3][3][3] = 8;</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">arr[2][3][4] = arr[3][3][3];</span></i><span style="font-size:10pt"></span></p>
<p class="MsoNormal"><span style="font-size:10pt">When evaluating
the statement ‘<i>arr[2][3][4] = arr[3][3][3]</i>’,
I want to get the two MemRegion which represent <i>arr[2][3][4] </i>and<i> arr[2][3][4]</i>
respectively. Since ‘<i>arr[2][3][4] = arr[3][3][3]</i>’ is essentially
an assign operator ‘=’ rooted BinaryOperator Expr, I can get its LHS and RHS
easily. The LHS is a ArraySubscriptExpr that represents the <i>arr[2][3][4]. </i>Although the RHS is an
ImpicitCastExpr (<LValueToRValue>), I can easily get its sub-Expr, which
is also an ArraySubscriptExpr representing the <i>arr[3][3][3]. </i>However, what I really want to get are the MemRegions
(ElementRegions) that representing <i>arr[2][3][4]
</i>and<i> arr[3][3][3] </i>respectively. Is
there any way to get the MemRegions (ElementRegions) through these ArraySubscriptExprs?
</span></p>
<p class="MsoNormal"><span style="font-size:10pt"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt">As for MemberExpr,
here is another example:</span></p>
<p class="MsoNormal"><i><span style="font-size:10pt">typedef struct {</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt"> int
a, b;</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">} Obj;</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">Obj o;</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">o.a = 9;</span></i></p>
<p class="MsoNormal"><i><span style="font-size:10pt">o.b = o.a</span></i><span style="font-size:10pt">;</span></p>
<p class="MsoNormal"><span style="font-size:10pt">When evaluating
the statement ‘<i>o.b = o.a</i>’, I want to
get the two MemRegion which represent <i>o.b
</i>and<i> o.b</i> respectively. Quite
similarly with the example above, I can get the two MemberExprs representing <i>o.b </i>and<i> o.b. </i>What I want to know is that, is there any way to get the MemRegions
(FieldRegions) through these MemberExprs? My structure here is quite simple. In
fact, the structure can be nested with tow or more hierarchies. So it means the
MemberExpr can also be nested. </span></p>
<p class="MsoNormal"><span style="font-size:10pt"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt">Any help would be
greatly appreciated. Thanks a lot. </span></p>
<div><br></div>-- <br><div dir="ltr"><font color="#444444">Best regards,</font><div><font color="#444444">Arthur Yoo</font></div></div>
</div>