[GCC-XML] Setting relative path for included user defined header files in C++ code

Brad King brad.king at kitware.com
Thu Sep 18 08:35:35 EDT 2014


On 09/17/2014 05:56 AM, Karanbir Singh wrote:
> Thanks a lot Brad. I am facing two more issues.
> 1) gccxml seems to be parsing a lot of code which is not in
> the current C++ file. I guess it is parsing the included
> header files. Is there a way to avoid this?

No.  The parser *is* a compiler.  It needs the full translation
unit just like any other compiler.  However, you can use
-fxml-start=some_decl to dump only a subset of the parsed
declarations to xml.

> 2) I need to dump the function bodies to xml as well.

This is not supported by gccxml.

> Does the patch offered by Daniel J Lauk succesfully dump
> function bodies to xml? 

Perhaps but it has not been maintained with the rest of gccxml
so I do not know if it would still work.

I suggest looking at Clang instead:

 http://clang.llvm.org/docs/Tooling.html

-Brad




More information about the gccxml mailing list