[cfe-dev] Traversing Constructor Body

Douglas Gregor dgregor at apple.com
Tue Oct 11 12:43:47 PDT 2011

On Oct 11, 2011, at 12:06 PM, Laurence Herbert wrote:

> Hi,
> I am currently on working on some analysis of C++ classes using Clang. I can successfully traverse the constructor's Initialization list and a classes member variables but I am stuck as to how to traverse the body of a constructor, i.e. 
> Test(int val1, int val2){
>         x = val1;
>         y = val2;
>  } 
> What method can I use to access the body of the constructor body (x = val1; , y = val2;) ?

FunctionDecl::getBody(), which CXXConstructorDecl inherits?

	- Doug

More information about the cfe-dev mailing list