clang 23.0.0git
EntityLinkage.cpp
Go to the documentation of this file.
1//===- EntityLinkage.cpp ----------------------------------------*- 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
10#include "llvm/Support/ErrorHandling.h"
11
12namespace clang::ssaf {
13
14llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
16 switch (Linkage) {
18 return OS << "None";
20 return OS << "Internal";
22 return OS << "External";
23 }
24 llvm_unreachable("Unhandled EntityLinkage::LinkageType variant");
25}
26
27llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
28 const EntityLinkage &Linkage) {
29 return OS << "EntityLinkage(" << Linkage.getLinkage() << ")";
30}
31
33 return Linkage == Other.Linkage;
34}
35
37 return !(*this == Other);
38}
39
40} // namespace clang::ssaf
Represents the linkage properties of an entity in the program model.
@ None
local variables, function parameters
@ Internal
static functions/variables, anonymous namespace
@ External
globally visible across translation units
bool operator!=(const EntityLinkage &Other) const
bool operator==(const EntityLinkage &Other) const
constexpr EntityLinkage(LinkageType L)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const BuildNamespace &BN)
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