[cfe-dev] Return type of statement

Alexei Svitkine alexei.svitkine at gmail.com
Mon Jan 5 17:43:25 PST 2009


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



More information about the cfe-dev mailing list