<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I want to rewrite a function thats fire an the error <span class="Apple-style-span" style="color: rgb(0, 0, 0); ">err_typecheck_call_too_few_args.</span><div><font class="Apple-style-span" color="#000000">Let me try a litle more...</font></div><div><font class="Apple-style-span" color="#000000"><br></font><br><hr id="stopSpelling">CC: cfe-dev@cs.uiuc.edu<br>From: clattner@apple.com<br>To: makslane@hotmail.com<br>Subject: Re: [cfe-dev] Function Call Rewriting<br>Date: Wed, 12 Aug 2009 09:26:01 -0700<br><br>What is your question?<div><br><div><div>On Aug 12, 2009, at 9:24 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-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="EC_hmmessage" style="font-size:10pt;font-family:Verdana">Thanks <span class="EC_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="EC_Apple-style-span" face="Tahoma, Verdana, Arial, sans-serif"><br></font></div><div><font class="EC_Apple-style-span" face="Tahoma, Verdana, Arial, sans-serif"><span class="EC_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="EC_stopSpelling">CC:<span class="EC_Apple-converted-space"> </span><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>From:<span class="EC_Apple-converted-space"> </span><a href="mailto:clattner@apple.com">clattner@apple.com</a><br>To:<span class="EC_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_EC_Apple-interchange-newline"><blockquote><span class="EC_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_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="EC_Apple-converted-space"> </span><a href="http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN;Hotmail&utm_medium=Tagline&utm_campaign=IE8">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></div><br /><hr />Quer uma internet mais segura? <a href='http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8' target='_new'>Baixe agora o novo Internet Explorer 8. É grátis!</a></body>
</html>