| 1 | //===- TUSummaryExtractor.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 | #ifndef LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_TUSUMMARY_TUSUMMARYEXTRACTOR_H |
| 10 | #define |
| 11 | |
| 12 | #include "clang/AST/ASTConsumer.h" |
| 13 | #include "clang/AST/Decl.h" |
| 14 | #include "clang/ScalableStaticAnalysis/Core/Model/EntityId.h" |
| 15 | #include <optional> |
| 16 | |
| 17 | namespace clang::ssaf { |
| 18 | class SSAFOptions; |
| 19 | class TUSummaryBuilder; |
| 20 | |
| 21 | class : public ASTConsumer { |
| 22 | public: |
| 23 | explicit (TUSummaryBuilder &Builder) |
| 24 | : SummaryBuilder(Builder) {} |
| 25 | |
| 26 | /// Creates EntityName from the Decl, registers the entity, and sets its |
| 27 | /// linkage atomically. |
| 28 | /// \returns the EntityId, or std::nullopt if EntityName creation fails. |
| 29 | std::optional<EntityId> (const NamedDecl *D); |
| 30 | |
| 31 | /// Creates EntityName for the return value of \p FD, registers the entity, |
| 32 | /// and sets its linkage atomically. |
| 33 | /// \returns the EntityId, or std::nullopt if EntityName creation fails. |
| 34 | std::optional<EntityId> (const FunctionDecl *FD); |
| 35 | |
| 36 | /// \returns the \c SSAFOptions of the builder. |
| 37 | const SSAFOptions &() const; |
| 38 | |
| 39 | protected: |
| 40 | TUSummaryBuilder &; |
| 41 | }; |
| 42 | |
| 43 | } // namespace clang::ssaf |
| 44 | |
| 45 | #endif // LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_TUSUMMARY_TUSUMMARYEXTRACTOR_H |
| 46 | |