Home | History | Annotate | Download | only in clang-check

Lines Matching full:clang

1 //===--- tools/clang-check/ClangCheck.cpp - Clang check tool --------------===//
10 // This file implements a clang-check tool that runs clang based on the info
13 // This tool uses the Clang Tooling infrastructure, see
14 // http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
19 #include "clang/AST/ASTConsumer.h"
20 #include "clang/Driver/Options.h"
21 #include "clang/Frontend/ASTConsumers.h"
22 #include "clang/Frontend/CompilerInstance.h"
23 #include "clang/Rewrite/Frontend/FixItRewriter.h"
24 #include "clang/Rewrite/Frontend/FrontendActions.h"
25 #include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
26 #include "clang/Tooling/CommonOptionsParser.h"
27 #include "clang/Tooling/Tooling.h"
32 using namespace clang::driver;
33 using namespace clang::tooling;
38 "\tFor example, to run clang-check on all files in a subtree of the\n"
41 "\t find path/in/subtree -name '*.cpp'|xargs clang-check\n"
45 "\t find path/in/subtree -name '*.cpp'|xargs clang-check -p build/path\n"
52 static cl::OptionCategory ClangCheckCategory("clang-check options");
93 class FixItOptions : public clang::FixItOptions {
101 "clang-fixit expects absolute paths only.");
103 // We don't need to do permission checking here since clang will diagnose
112 /// \brief Subclasses \c clang::FixItRewriter to not count fixed errors/warnings
115 /// This has the side-effect that clang-check -fixit exits with code 0 on
117 class FixItRewriter : public clang::FixItRewriter {
119 FixItRewriter(clang::DiagnosticsEngine& Diags,
120 clang::SourceManager& SourceMgr,
121 const clang::LangOptions& LangOpts,
122 clang::FixItOptions* FixItOpts)
123 : clang::FixItRewriter(Diags, SourceMgr, LangOpts, FixItOpts) {
129 /// \brief Subclasses \c clang::FixItAction so that we can install the custom
131 class FixItAction : public clang::FixItAction {
133 bool BeginSourceFileAction(clang::CompilerInstance& CI,
142 class InsertAdjuster: public clang::tooling::ArgumentsAdjuster {
182 clang::ASTConsumer *newASTConsumer() {
184 return clang::CreateASTDeclNodeLister();
186 return clang::CreateASTDumper(ASTDumpFilter);
188 return clang::CreateASTPrinter(&llvm::outs(), ASTDumpFilter);
189 return new clang::ASTConsumer();
222 FrontendFactory = newFrontendActionFactory<clang::ento::AnalysisAction>();