[cfe-dev] XML generation via plugin API

Douglas Gregor dgregor at apple.com
Fri Jun 10 08:02:03 PDT 2011


On Jun 9, 2011, at 1:06 PM, Timothy McClory wrote:

> Our group is developing a tool that analyzes C code, and we would like to leverage the robustness of the clang frontend.  I would appreciate any feedback of our proposed approach:
> 
> Assume our tool is capable of dumping it's internal AST to an XML file, and importing from an XML file.  Our plan is to write an ASTConsumer that will output an XML representation of clang's AST that conforms to our XML schema.  Our goal is to produce output similar to the (deprecated?) -ast-print-xml option, though augmented with more detail such as preprocessor information.
> 
> I think that this could be written as a plugin, much like the PrintFunctionNames example.  This is the question I am most interested in: is writing a plugin the proper approach for the use case described?

Yes, writing a plugin is the best approach.

	- Doug




More information about the cfe-dev mailing list