[cfe-dev] Distinguishing system headers from user headers using libclang
akyrtzi at gmail.com
Thu Apr 4 15:22:26 PDT 2013
On Apr 2, 2013, at 1:33 AM, Mikołaj Siedlarek <m.siedlarek at nctz.net> wrote:
> I'm writing a simple code dependency analysis tool using libclang and I'm missing some way of distinguishing system headers from user headers. I see clang::DirectoryLookup::getDirCharacteristic() provides such interface, but is there any way I could obtain this information using just libclang? My tool is rather simple and I'd like to keep it that way - libclang seems to be sufficient for the rest of my needs.
There is no way currently, but it should relatively easy, are you interested in providing such a patch ?
The clang function you may need to look into using is "SourceManager::isInSystemHeader(SourceLocation Loc)"
The libclang function would accept a CXTranslationUnit and a CXSourceLocation.
> Mikołaj Siedlarek
> m.siedlarek at nctz.net
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev