how to know if a class/function are declared in an include hearder file ?

Hello,

I develop a source-to-source project for fun and to learn clang. The idea is to generate an xml of a function or class declared in a header file which is an input of my program. But if this header file has an #include directive the code generate also an xml for functions/classes declared in this one and i would like to avoid it.

There exist a way to know in which file a clang::Decl object is declared ?

SourceManager::getFileName returns my input file so i can’t compare file name.

Thanks in advance,

karpalo.

Hi,