[cfe-dev] Function Call Rewriting
Makslane Araújo Rodrigues
makslane at hotmail.com
Wed Aug 12 09:24:35 PDT 2009
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
_________________________________________________________________
Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. É 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/20090812/12c64730/attachment.html>
More information about the cfe-dev
mailing list