[cfe-dev] Return type of statement
kremenek at apple.com
Mon Jan 5 20:10:52 CST 2009
Statements that evalute to a value are known as expressions.
Expressions are represented by the Expr class (which subclasses
Stmt). The method Expr::getType() will return the information you
want. I recommend looking at the Clang sources for example uses of
On Jan 5, 2009, at 5:43 PM, Alexei Svitkine
<alexei.svitkine at gmail.com> wrote:
> I am starting a project that will use clang. I'm asking to be pointed
> in the right direction with a question I have. Here goes.
> Given a context (ie a source file) and a statement somewhere in that
> file, what's the easiest way to find the return type of that statement
> with clang?
> For example, for an assignment, it's the type of the variable, for a
> function call, it's the return type, but obviously there are more
> complicated examples in C semantics.
> Surely, clang must be aware of this information, so what's the easiest
> way to get at it (using code)?
> -Alexei Svitkine
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
More information about the cfe-dev