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 /// \brief 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 22 namespace clang { 23 24 class Stmt; 25 26 namespace ento { 27 28 /// \brief ASTConsumer to consume model files' AST. 29 /// 30 /// This consumer collects the bodies of function definitions into a StringMap 31 /// from a model file. 32 class ModelConsumer : public ASTConsumer { 33 public: 34 ModelConsumer(llvm::StringMap<Stmt *> &Bodies); 35 36 bool HandleTopLevelDecl(DeclGroupRef D) override; 37 38 private: 39 llvm::StringMap<Stmt *> &Bodies; 40 }; 41 } 42 } 43 44 #endif 45