[cfe-dev] Tooling: disable standard compile-run

Robert Zimmermann tsett at gmx.net
Sun Feb 23 02:50:07 PST 2014


Hello,
I wrote a small program for Windows using LibTooling to implement
additional syntax-checking.
For this I use a MatchFinder with several matchers and later I start
ClangTool.run()
Here a code example:

ClangTool Tool(...);
MatchFinder Finder;
for (vector<BaseChecker*>::iterator iter = checkers->begin(); iter !=
checkers->end(); iter++)
{
  BaseChecker* checker = *iter;
  Finder.addMatcher(*checker->getMatcher(),
static_cast<MatchFinder::MatchCallback*>(checker));
}
ret = Tool.run(newFrontendActionFactory(&Finder));

If I run my tool on c++-code I got the problem that it do not find all
the standard c++-header, but the rest of my matchers is working.
I know that I could add the path to the FrontEnd.h, but then it will
only work on systems with the same path.

I also tried to add them via the -I switch, but I got a lot of errors in
these files.

The question is: Can I disable the standard compile-run (with a switch
or in my code) and just create the AST and run the MatchFinder?

Best,
Robert



More information about the cfe-dev mailing list