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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Hans Wennborg via cfe-dev
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.

Garanti sans virus. www.avast.com

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

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

Hans Wennborg via cfe-dev
Hi,

On Sat, Feb 17, 2018 at 10:33:50PM +0100, ogzu rasa via cfe-dev <[hidden email]> wrote:
> SourceManager::getFileName returns my input file so i can't compare file
> name.

Did you try SourceManager.isInMainFile(loc)?

Regards,

Miklos

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

signature.asc (188 bytes) Download Attachment