<div dir="ltr">With getBase(), I will get an Expr, but how do I get the actual base? In other words, all I want is a string "blockIdx" so that I can perform something like <div>if(string == "blockIdx"){</div><div> Rewrite.replaceText()......</div><div>}</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 7, 2017 at 3:49 AM, Aleksei Sidorin <span dir="ltr"><<a href="mailto:a.sidorin@samsung.com" target="_blank">a.sidorin@samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_6687090213520366181moz-cite-prefix">Hello,<br>
<br>
You can use getBase() method to retrieve 'blockIdx' and
getMemberDecl() to find out what declaration is being referred.<br>
<br>
07.12.2017 11:40, Qiufeng Yu via cfe-dev пишет:<br>
</div>
<blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I'm new to clang and currently working on a project where I
need to rewrite some codes in CUDA source file.</div>
<div><br>
</div>
<div>For example, if I have the following CUDA code:</div>
<div><br>
</div>
<div>int bx = blockIdx.x;</div>
<div>int by = blockIdx.y;</div>
<div><br>
</div>
<div>I want to rewrite the blockIdx and blockIdx.x and
blockIdx.y to some other code:</div>
<div>int bx = something else;</div>
<div>int by = something else;</div>
<div><br>
</div>
<div>My problem is that how do I find the MemberExpr blockIdx,x
and blockIdx.y?</div>
<div><br>
</div>
<div>I know how to get the MemberExpr, but I have no clue how to
extract the name of the MemberExpr in order to know that it is
the right MemberExpr for me to rewrite.</div>
<div><br>
</div>
<div>Any help is appreciated.</div>
<div><br>
</div>
<div><br>
</div>
<div>Patrick</div>
</div>
<br>
<fieldset class="m_6687090213520366181mimeAttachmentHeader"></fieldset>
<br>
</div></div><span class=""><pre>______________________________<wbr>_________________
cfe-dev mailing list
<a class="m_6687090213520366181moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>
<a class="m_6687090213520366181moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a>
</pre>
</span></blockquote><span class="HOEnZb"><font color="#888888">
<p><br>
</p>
<pre class="m_6687090213520366181moz-signature" cols="72">--
Best regards,
Aleksei Sidorin,
SRR, Samsung Electronics
</pre>
</font></span></div>
</blockquote></div><br></div>