[cfe-dev] How to analyze a C++ header file with a clang tool?

Jacob Carlborg doob at me.com
Tue Jun 3 23:52:54 PDT 2014


On 04/06/14 02:51, Manasij Mukherjee wrote:
> Hi
> I have seen the examples in clang/tools/, and even built a few simple
> tools myself.
> But all of them work on source files.
> For example, I am not sure if I can use clang-check on a header file.
>
> How do I write a clang tool that will allow me to read a header file and
> ..say.. print the names of all the top level declarations?
> This is easy for a source file but I can not figure out how to handle
> headers.

Is there a difference? Just pass the header file to the tool instead. 
Clang (whichever libraries you use) won't make a difference, as far as I 
know.

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list