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