[cfe-dev] Get the global variables (members) of a given C++ class

Miguel Aguilar miguel.aguilar at ice.rwth-aachen.de
Tue Jan 22 04:21:47 PST 2013


Hi,

I am wondering if for a given c++ class record (CXXRecordDecl) is 
possible to walk through the global variables (members).


For example:

class Consumer : public Process
{
public:
   Consumer(const Id& n, In<int>& i);
   const char* type() const;
   void main();

private:
   InPort<int> in;
};


Here I would like to parse the member  "InPort<int> in;" in order to get 
the type and the name of the variable.

Thanks,

Miguel



More information about the cfe-dev mailing list