<div dir="ltr">+1 to that.<div><br></div><div>Sometime ago, I tried to get an unique ID generated by clang but couldn't find any .get_whatever() to solve the problem.</div><div><br></div><div>I ended up using the pointer's address as an ID, as it seems to be unique. </div><div><br></div><div>For example:</div><div><br></div><div>const clang::TagDecl &tag;<br></div><div>std::size_t address = reinterpret_cast<std::size_t>(tag.getFirstDecl());<br></div><div><br></div><div>It's basically the same code for all decls. I use getFirstDecl to avoid having different IDs for the same decl.</div><div><br></div><div>If there is a better way to do that, I would like to know too.</div><div><br></div><div>Thank you,</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-12 17:29 GMT+01:00 Raboudi Amel via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div>Hi All,</div></div><div><br></div><div>I am using clang C++ API's to parse a source code and then generates its AST.</div><div>I need for that to find a way to uniquely identify my AST declarations.</div><div><br></div><div>refering to this Doxygen Documentation:  <a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html#a57cf20fc798dae7f5fba3e21d455df6b" target="_blank">http://clang.llvm.org/<wbr>doxygen/classclang_1_1Decl.<wbr>html#<wbr>a57cf20fc798dae7f5fba3e21d455d<wbr>f6b</a></div><div><br></div><div>the getGlobalID() function must do the task, but, it returns nothing.</div><div><br></div><div>Can anyone helps me to find this unique ID in clang's C++ APIs?</div><div><br></div><div>Thank you !</div><div>Amel</div><div><br></div><div><br></div></div></div></div></div>
</div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=acmFib3VkaS5hbWVsLmVuc2lAZ21haWwuY29t&type=zerocontent&guid=9c3286e9-80ec-47c9-9be6-7cdf40428994"><font color="#ffffff" size="1">ᐧ</font></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div><div>Mikhail Ramalho.</div></div></div>
</div>