ModelConsumer.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- ModelConsumer.h -----------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// This file implements clang::ento::ModelConsumer which is an
  16. /// ASTConsumer for model files.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_MODELCONSUMER_H
  20. #define LLVM_CLANG_STATICANALYZER_FRONTEND_MODELCONSUMER_H
  21. #include "clang/AST/ASTConsumer.h"
  22. #include "llvm/ADT/StringMap.h"
  23. namespace clang {
  24. class Stmt;
  25. namespace ento {
  26. /// ASTConsumer to consume model files' AST.
  27. ///
  28. /// This consumer collects the bodies of function definitions into a StringMap
  29. /// from a model file.
  30. class ModelConsumer : public ASTConsumer {
  31. public:
  32. ModelConsumer(llvm::StringMap<Stmt *> &Bodies);
  33. bool HandleTopLevelDecl(DeclGroupRef D) override;
  34. private:
  35. llvm::StringMap<Stmt *> &Bodies;
  36. };
  37. }
  38. }
  39. #endif
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif