<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">What is your question?<div><br><div><div>On Aug 12, 2009, at 9:24 AM, Makslane Araújo Rodrigues wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Thanks <span class="Apple-style-span" style="font-family: Tahoma, Verdana, Arial, sans-serif; ">Chris, but what I want is to use the clang to rewrite the function call, like this:</span><div><font class="Apple-style-span" face="Tahoma, Verdana, Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Tahoma, Verdana, Arial, sans-serif"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Verdana, Verdana, Arial, sans-serif; "><div>void func1(int a) {}</div><div><br></div><div>void func2()</div><div>{</div><div>   func1(); //clang fires the error here</div><div>}</div><div><br></div><div>The code is rewrited to:</div><div><br></div><div><div>void func2()</div><div>{</div><div>   func1(some int var); </div><div>}</div></div></span></font><br><hr id="stopSpelling">CC:<span class="Apple-converted-space"> </span><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>From:<span class="Apple-converted-space"> </span><a href="mailto:clattner@apple.com">clattner@apple.com</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:makslane@hotmail.com">makslane@hotmail.com</a><br>Subject: Re: [cfe-dev] Function Call Rewriting<br>Date: Wed, 12 Aug 2009 09:19:27 -0700<br><br><br><div><div>On Aug 12, 2009, at 6:28 AM, Makslane Araújo Rodrigues wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; "><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana; ">Hi again!<div><br></div><div>I want to catch the err_typecheck_call_too_few_args error (int the DiagnosticClient::HandleDiagnostic) and get the function call thats causes the error:</div><div><br></div><div>void func1(int a) {}</div><div><br></div><div>void func2()</div><div>{</div><div>   func1(); //error here</div><div>}</div><div><br></div><div>I've no idea how to get the information that is the func1 call is causing the error.</div></div></span></blockquote><div><br></div>the easiest way to find it is with grep:</div><div><br></div><div>$ cd llvm/tools/clang</div><div>$ grep err_typecheck_call_too_few_args lib/*/*<div>lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaChecking.cpp:                          diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaChecking.cpp:                              diag::err_typecheck_call_too_few_args)</div><div>lib/Sema/SemaExpr.cpp:      return Diag(RParenLoc, diag::err_typecheck_call_too_few_args)</div><div><br></div><div>-Chris</div><div><br></div></div></div><br><hr>Novo Internet Explorer 8: mais rápido e muito mais seguro.<span class="Apple-converted-space"> </span><a href="http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8" target="_new">Baixe agora, é grátis!</a>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div></span></blockquote></div><br></div></body></html>