<div dir="ltr">Thanks for the reply. Well, here's the detailed problem. Once all the syntax checking has been done, the next step before generating IR is to do semantic analysis and type checking. Let us say that I encounter a code like this:<div>
<br></div><div style>string b;</div><div style>vector<T> a;</div><div style>cout<<b;</div><div style>cout<<a;</div><div style> </div><div style>      How does clang figure out that the 3rd statement is valid because an operator for string exists, while the 4rth statement is not valid. More specifically, I want to know how clang searches through all the operators (or functions). I have to use this functionality. Does the clang api allow me to do this easily or will I have to replicate this functionality?</div>
<div style><br></div><div style>Regards,</div><div style>Adil</div><div style><br></div><div style><br></div><div style>        </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 4:35 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Thu, Jan 24, 2013 at 12:49 PM, madil90 <span dir="ltr"><<a href="mailto:madil90@gmail.com" target="_blank">madil90@gmail.com</a>></span> wrote:<br>
<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
   I am looking to perform some semantic analysis in clang. More<br>
specifically, I want to know whether a function exists for a certain type.<br>
The function is global. e.g.<br>
<br>
String toString(A a);<br>
<br>
    I want to differentiate that this function exists for type A and not for<br>
type B. I have built an AST and am parsing it. How can I achieve this?<br>
(Whenever I encounter a type)<br></blockquote><div><br></div><div>I'd loop over all declarations of toString and see which type they take... Perhaps I'm misunderstanding your problem though :)</div><div>
<br></div><div>Cheers,</div><div>/Manuel</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards,<br>
Adil<br>
<br>
<br><span class="HOEnZb"><font color="#888888">
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Semantic-Analysis-in-Clang-tp4030012.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Semantic-Analysis-in-Clang-tp4030012.html</a><br>


Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Mohammad Adil<div>LUMS SSE</div>
</div>