clang 24.0.0git
VirtualMethodFamily.h
Go to the documentation of this file.
1//===- VirtualMethodFamily.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_ANALYSES_VIRTUALMETHODFAMILY_VIRTUALMETHODFAMILY_H
10#define LLVM_CLANG_SCALABLESTATICANALYSIS_ANALYSES_VIRTUALMETHODFAMILY_VIRTUALMETHODFAMILY_H
11
15#include "llvm/ADT/StringRef.h"
16#include <optional>
17#include <tuple>
18#include <vector>
19
20namespace clang::ssaf {
21
22struct VirtualMethodSummary final : public EntitySummary {
23 static constexpr llvm::StringLiteral Name = "VirtualMethod";
24
25 static SummaryName summaryName() { return SummaryName(Name.str()); }
26
27 SummaryName getSummaryName() const override { return summaryName(); }
28
29 /// EntityIds of each ParmVarDecl, in source order.
30 std::vector<EntityId> ParamEntities;
31
32 /// EntityId of the synthetic return-slot entity for this method.
33 std::optional<EntityId> ReturnEntity;
34
35 /// The result of \c CXXMethodDecl::overridden_methods().
36 std::vector<EntityId> OverriddenMethods;
37
39 return std::tie(ParamEntities, ReturnEntity, OverriddenMethods) ==
40 std::tie(Other.ParamEntities, Other.ReturnEntity,
41 Other.OverriddenMethods);
42 }
43
45 return !(*this == Other);
46 }
47};
48
49} // namespace clang::ssaf
50
51#endif // LLVM_CLANG_SCALABLESTATICANALYSIS_ANALYSES_VIRTUALMETHODFAMILY_VIRTUALMETHODFAMILY_H
Base class for analysis-specific summary data.
Uniquely identifies an analysis summary.
Definition SummaryName.h:22
@ Other
Other implicit parameter.
Definition Decl.h:1775
static constexpr llvm::StringLiteral Name
bool operator!=(const VirtualMethodSummary &Other) const
bool operator==(const VirtualMethodSummary &Other) const
std::vector< EntityId > ParamEntities
EntityIds of each ParmVarDecl, in source order.
SummaryName getSummaryName() const override
std::optional< EntityId > ReturnEntity
EntityId of the synthetic return-slot entity for this method.
std::vector< EntityId > OverriddenMethods
The result of CXXMethodDecl::overridden_methods().