1//===-- ModelConsumer.h -----------------------------------------*- C++ -*-===//
2//
3// 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
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file implements clang::ento::ModelConsumer which is an
11/// ASTConsumer for model files.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_MODELCONSUMER_H
16#define LLVM_CLANG_STATICANALYZER_FRONTEND_MODELCONSUMER_H
17
18#include "clang/AST/ASTConsumer.h"
19#include "llvm/ADT/StringMap.h"
20
21namespace clang {
22
23class Stmt;
24
25namespace ento {
26
27/// ASTConsumer to consume model files' AST.
28///
29/// This consumer collects the bodies of function definitions into a StringMap
30/// from a model file.
31class ModelConsumer : public ASTConsumer {
32public:
33 ModelConsumer(llvm::StringMap<Stmt *> &Bodies);
34
35 bool HandleTopLevelDecl(DeclGroupRef D) override;
36
37private:
38 llvm::StringMap<Stmt *> &Bodies;
39};
40}
41}
42
43#endif
44

source code of clang/include/clang/StaticAnalyzer/Frontend/ModelConsumer.h