[cfe-dev] Function Call Rewriting

Chris Lattner clattner at apple.com
Wed Aug 12 09:26:01 PDT 2009


What is your question?

On Aug 12, 2009, at 9:24 AM, Makslane Araújo Rodrigues wrote:

> Thanks Chris, but what I want is to use the clang to rewrite the  
> function call, like this:
>
> void func1(int a) {}
>
> void func2()
> {
>    func1(); //clang fires the error here
> }
>
> The code is rewrited to:
>
> void func2()
> {
>    func1(some int var);
> }
>
> CC: cfe-dev at cs.uiuc.edu
> From: clattner at apple.com
> To: makslane at hotmail.com
> Subject: Re: [cfe-dev] Function Call Rewriting
> Date: Wed, 12 Aug 2009 09:19:27 -0700
>
>
> On Aug 12, 2009, at 6:28 AM, Makslane Araújo Rodrigues wrote:
>
> Hi again!
>
> 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:
>
> void func1(int a) {}
>
> void func2()
> {
>    func1(); //error here
> }
>
> I've no idea how to get the information that is the func1 call is  
> causing the error.
>
> the easiest way to find it is with grep:
>
> $ cd llvm/tools/clang
> $ grep err_typecheck_call_too_few_args lib/*/*
> lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(),  
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(),  
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(),  
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaChecking.cpp:    return Diag(TheCall->getLocEnd(),  
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaChecking.cpp:                           
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaChecking.cpp:                               
> diag::err_typecheck_call_too_few_args)
> lib/Sema/SemaExpr.cpp:      return Diag(RParenLoc,  
> diag::err_typecheck_call_too_few_args)
>
> -Chris
>
>
> Novo Internet Explorer 8: mais rápido e muito mais seguro. Baixe  
> agora, é grátis!_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090812/842ce6cb/attachment.html>


More information about the cfe-dev mailing list