blob: 04fbd0cea46b672e25e1474cb16c63b75d5689a2 [file] [log] [blame]
Daniel Dunbarc1b17292010-06-15 17:48:49 +00001//===--- FrontendActions.cpp ----------------------------------------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Daniel Dunbarc1b17292010-06-15 17:48:49 +00006//
7//===----------------------------------------------------------------------===//
8
Argyrios Kyrtzidis556c45e2011-02-14 18:13:31 +00009#include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
Alexander Kornienko6de39492014-01-03 17:23:10 +000010#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
Ted Kremenekeeccb302014-08-27 15:14:15 +000011#include "clang/StaticAnalyzer/Frontend/ModelConsumer.h"
Daniel Dunbarc1b17292010-06-15 17:48:49 +000012using namespace clang;
Ted Kremenek98857c92010-12-23 07:20:52 +000013using namespace ento;
Daniel Dunbarc1b17292010-06-15 17:48:49 +000014
David Blaikie6beb6aa2014-08-10 19:56:51 +000015std::unique_ptr<ASTConsumer>
16AnalysisAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
Ted Kremenekeeccb302014-08-27 15:14:15 +000017 return CreateAnalysisConsumer(CI);
Daniel Dunbarc1b17292010-06-15 17:48:49 +000018}
19
Ted Kremenekeeccb302014-08-27 15:14:15 +000020ParseModelFileAction::ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies)
21 : Bodies(Bodies) {}
22
23std::unique_ptr<ASTConsumer>
24ParseModelFileAction::CreateASTConsumer(CompilerInstance &CI,
25 StringRef InFile) {
Jonas Devlieghere2b3d49b2019-08-14 23:04:18 +000026 return std::make_unique<ModelConsumer>(Bodies);
Ted Kremenekeeccb302014-08-27 15:14:15 +000027}