[cfe-dev] Looking up names after parsing

Abramo Bagnara abramo.bagnara at gmail.com
Sun Nov 6 08:35:19 PST 2011


I'm looking for the "right" way to resolve a name wrt an already parsed AST.

The lookup context would be the same we have at end of translation unit.

E.g. suppose my translation unit content is the following:

#include <vector>

namespace ns {
std::vector<int> v;
}

Now, after translation unit parsing has been completed I need to get:

a) Type* from string "std::vector<int>" (or NULL if this is not parsable)

b) NamedDecl* from string "ns::v" (or NULL if this is not parsable)

What's the Right(TM) way to do that using clang library?



More information about the cfe-dev mailing list