xref: /freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric //===--- FrontendActions.cpp ----------------------------------------------===//
2*0b57cec5SDimitry Andric //
3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric //
7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric 
9*0b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
10*0b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
11*0b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Frontend/ModelConsumer.h"
12*0b57cec5SDimitry Andric using namespace clang;
13*0b57cec5SDimitry Andric using namespace ento;
14*0b57cec5SDimitry Andric 
15*0b57cec5SDimitry Andric std::unique_ptr<ASTConsumer>
16*0b57cec5SDimitry Andric AnalysisAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
17*0b57cec5SDimitry Andric   return CreateAnalysisConsumer(CI);
18*0b57cec5SDimitry Andric }
19*0b57cec5SDimitry Andric 
20*0b57cec5SDimitry Andric ParseModelFileAction::ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies)
21*0b57cec5SDimitry Andric     : Bodies(Bodies) {}
22*0b57cec5SDimitry Andric 
23*0b57cec5SDimitry Andric std::unique_ptr<ASTConsumer>
24*0b57cec5SDimitry Andric ParseModelFileAction::CreateASTConsumer(CompilerInstance &CI,
25*0b57cec5SDimitry Andric                                         StringRef InFile) {
26*0b57cec5SDimitry Andric   return llvm::make_unique<ModelConsumer>(Bodies);
27*0b57cec5SDimitry Andric }
28