1 //===-- ModelConsumer.h -----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 /// This file implements clang::ento::ModelConsumer which is an
11 /// ASTConsumer for model files.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_GR_MODELCONSUMER_H
16 #define LLVM_CLANG_GR_MODELCONSUMER_H
18 #include "clang/AST/ASTConsumer.h"
19 #include "llvm/ADT/StringMap.h"
27 /// ASTConsumer to consume model files' AST.
29 /// This consumer collects the bodies of function definitions into a StringMap
30 /// from a model file.
31 class ModelConsumer : public ASTConsumer {
33 ModelConsumer(llvm::StringMap<Stmt *> &Bodies);
35 bool HandleTopLevelDecl(DeclGroupRef D) override;
38 llvm::StringMap<Stmt *> &Bodies;