clang 23.0.0git
TUSummaryExtractor.h
Go to the documentation of this file.
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_SCALABLESTATICANALYSISFRAMEWORK_CORE_TUSUMMARY_TUSUMMARYEXTRACTOR_H
10#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_TUSUMMARY_TUSUMMARYEXTRACTOR_H
11
13#include "clang/AST/Decl.h"
15#include <optional>
16
17namespace clang::ssaf {
19
21public:
23 : SummaryBuilder(Builder) {}
24
25 /// Creates EntityName from the Decl, registers the entity, and sets its
26 /// linkage atomically.
27 /// \returns the EntityId, or std::nullopt if EntityName creation fails.
28 std::optional<EntityId> addEntity(const NamedDecl *D);
29
30 /// Creates EntityName for the return value of \p FD, registers the entity,
31 /// and sets its linkage atomically.
32 /// \returns the EntityId, or std::nullopt if EntityName creation fails.
33 std::optional<EntityId> addEntityForReturn(const FunctionDecl *FD);
34
35protected:
37};
38
39} // namespace clang::ssaf
40
41#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_TUSUMMARY_TUSUMMARYEXTRACTOR_H
ASTConsumer()=default
Represents a function declaration or definition.
Definition Decl.h:2018
This represents a decl that may have a name.
Definition Decl.h:274
std::optional< EntityId > addEntityForReturn(const FunctionDecl *FD)
Creates EntityName for the return value of FD, registers the entity, and sets its linkage atomically.
TUSummaryExtractor(TUSummaryBuilder &Builder)
std::optional< EntityId > addEntity(const NamedDecl *D)
Creates EntityName from the Decl, registers the entity, and sets its linkage atomically.