1 //===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
11 #define LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
13 #include "clang/Frontend/FrontendAction.h"
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/ADT/StringRef.h"
20 class AnalyzerOptions;
24 //===----------------------------------------------------------------------===//
25 // AST Consumer Actions
26 //===----------------------------------------------------------------------===//
28 class AnalysisAction : public ASTFrontendAction {
30 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
31 StringRef InFile) override;
34 /// Frontend action to parse model files.
36 /// This frontend action is responsible for parsing model files. Model files can
37 /// not be parsed on their own, they rely on type information that is available
38 /// in another translation unit. The parsing of model files is done by a
39 /// separate compiler instance that reuses the ASTContext and othen information
40 /// from the main translation unit that is being compiled. After a model file is
41 /// parsed, the function definitions will be collected into a StringMap.
42 class ParseModelFileAction : public ASTFrontendAction {
44 ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies);
45 bool isModelParsingAction() const override { return true; }
48 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
49 StringRef InFile) override;
52 llvm::StringMap<Stmt *> &Bodies;
55 void printCheckerHelp(raw_ostream &OS, ArrayRef<std::string> plugins);
56 void printEnabledCheckerList(raw_ostream &OS, ArrayRef<std::string> plugins,
57 const AnalyzerOptions &opts);
61 } // end namespace clang