[cfe-dev] Function Call Rewriting

Makslane Araújo Rodrigues makslane at hotmail.com
Wed Aug 12 14:18:52 PDT 2009


I want to rewrite a function thats fire an the error err_typecheck_call_too_few_args.Let me try a litle more...

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:26:01 -0700

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


_________________________________________________________________
Emoticons e Winks super diferentes para o Messenger. Baixe agora, é grátis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090813/8e7743cf/attachment.html>


More information about the cfe-dev mailing list