<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
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: 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: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-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">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. <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></body>
</html>