determining header inclusion path

Hi,

I'm trying to find how each C declaration is included from the
originating source file. Specifically, say, I have a Decl object, and
I want to know where this Decl is declared. And if it's in a header
file, I want to know the inclusion path from the originating source
file. For example, if main.c includes foo.h, and foo.h includes bar.h,
I want to know the inclusion path of each declaration in bar.h to be
something like "main.c->foo.h->bar.h". Would anybody please tell me
how to find this information from Decl objects in clang?

Regards,

Naoya

Get the location of the decl (with Decl::getLocation()), then use the SourceManager to retrieve information about that source location: whether it comes from a macro instantiation, what file it was instantiated in, and (then) the include path.

  - Doug