clang 23.0.0git
EntityLinkage.h
Go to the documentation of this file.
1//===- EntityLinkage.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_MODEL_ENTITYLINKAGE_H
10#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_MODEL_ENTITYLINKAGE_H
11
12#include "llvm/ADT/StringRef.h"
13#include "llvm/Support/raw_ostream.h"
14
15namespace clang::ssaf {
16
18 None, ///< local variables, function parameters
19 Internal, ///< static functions/variables, anonymous namespace
20 External ///< globally visible across translation units
21};
22
23/// Represents the linkage properties of an entity in the program model.
24///
25/// EntityLinkage captures whether an entity has no linkage, internal linkage,
26/// or external linkage, which determines its visibility and accessibility
27/// across translation units.
29 friend class SerializationFormat;
30 friend class TestFixture;
31
32public:
33 constexpr explicit EntityLinkage(EntityLinkageType L) : Linkage(L) {}
34
35 EntityLinkageType getLinkage() const { return Linkage; }
36
37 bool operator==(const EntityLinkage &Other) const;
38 bool operator!=(const EntityLinkage &Other) const;
39
40private:
42};
43
44/// Writes a string representation of the linkage type to the stream.
45llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, EntityLinkageType Linkage);
46
47llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
48 const EntityLinkage &Linkage);
49
50} // namespace clang::ssaf
51
52#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_MODEL_ENTITYLINKAGE_H
Represents the linkage properties of an entity in the program model.
bool operator!=(const EntityLinkage &Other) const
constexpr EntityLinkage(EntityLinkageType L)
EntityLinkageType getLinkage() const
bool operator==(const EntityLinkage &Other) const
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, BuildNamespaceKind BNK)
@ None
local variables, function parameters
@ Internal
static functions/variables, anonymous namespace
@ External
globally visible across translation units
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition Linkage.h:24
@ Other
Other implicit parameter.
Definition Decl.h:1746