[cfe-dev] Using libtooling to parse C++ code

Cong Yan congyan91 at gmail.com
Fri Nov 14 13:44:33 PST 2014

How did you do that? Did you change the language option somewhere?

This is what I included in the main function:

CommonOptionsParser op(argc, argv);
// create a new Clang Tool instance (a LibTooling environment)
ClangTool Tool(op.getCompilations(), op.getSourcePathList());
// run the Clang Tool, creating a new FrontendAction (explained below)
int result = Tool.run(newFrontendActionFactory<myFrontendAction>());

 It seems that C is the default language in CompilerInstance and CompilerInvocation. Should I do something to change that? Or I should pass some argument when I run the tool I write?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141114/498197f7/attachment.html>

More information about the cfe-dev mailing list