Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:10

0001 //===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
0010 #define LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
0011 
0012 #include "clang/Frontend/FrontendAction.h"
0013 #include "llvm/ADT/StringMap.h"
0014 #include "llvm/ADT/StringRef.h"
0015 
0016 namespace clang {
0017 
0018 class Stmt;
0019 
0020 namespace ento {
0021 
0022 //===----------------------------------------------------------------------===//
0023 // AST Consumer Actions
0024 //===----------------------------------------------------------------------===//
0025 
0026 class AnalysisAction : public ASTFrontendAction {
0027 protected:
0028   std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
0029                                                  StringRef InFile) override;
0030 };
0031 
0032 /// Frontend action to parse model files.
0033 ///
0034 /// This frontend action is responsible for parsing model files. Model files can
0035 /// not be parsed on their own, they rely on type information that is available
0036 /// in another translation unit. The parsing of model files is done by a
0037 /// separate compiler instance that reuses the ASTContext and othen information
0038 /// from the main translation unit that is being compiled. After a model file is
0039 /// parsed, the function definitions will be collected into a StringMap.
0040 class ParseModelFileAction : public ASTFrontendAction {
0041 public:
0042   ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies);
0043   bool isModelParsingAction() const override { return true; }
0044 
0045 protected:
0046   std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
0047                                                  StringRef InFile) override;
0048 
0049 private:
0050   llvm::StringMap<Stmt *> &Bodies;
0051 };
0052 
0053 } // namespace ento
0054 } // end namespace clang
0055 
0056 #endif