xref: /freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp (revision 5b27928474e6a4103d65b347544705c40c9618fd)
10b57cec5SDimitry Andric //===--- FrontendActions.cpp ----------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
100b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
110b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/ModelConsumer.h"
120b57cec5SDimitry Andric using namespace clang;
130b57cec5SDimitry Andric using namespace ento;
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric std::unique_ptr<ASTConsumer>
CreateASTConsumer(CompilerInstance & CI,StringRef InFile)160b57cec5SDimitry Andric AnalysisAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
170b57cec5SDimitry Andric   return CreateAnalysisConsumer(CI);
180b57cec5SDimitry Andric }
190b57cec5SDimitry Andric 
ParseModelFileAction(llvm::StringMap<Stmt * > & Bodies)200b57cec5SDimitry Andric ParseModelFileAction::ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies)
210b57cec5SDimitry Andric     : Bodies(Bodies) {}
220b57cec5SDimitry Andric 
230b57cec5SDimitry Andric std::unique_ptr<ASTConsumer>
CreateASTConsumer(CompilerInstance & CI,StringRef InFile)240b57cec5SDimitry Andric ParseModelFileAction::CreateASTConsumer(CompilerInstance &CI,
250b57cec5SDimitry Andric                                         StringRef InFile) {
26*a7dea167SDimitry Andric   return std::make_unique<ModelConsumer>(Bodies);
270b57cec5SDimitry Andric }
28