| 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 | |
| 9 | #include "clang/Analysis/Scalable/Model/EntityLinkage.h" |
| 10 | #include "llvm/Support/ErrorHandling.h" |
| 11 | |
| 12 | namespace clang::ssaf { |
| 13 | |
| 14 | llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, |
| 15 | EntityLinkage::LinkageType Linkage) { |
| 16 | switch (Linkage) { |
| 17 | case EntityLinkage::LinkageType::None: |
| 18 | return OS << "None"; |
| 19 | case EntityLinkage::LinkageType::Internal: |
| 20 | return OS << "Internal"; |
| 21 | case EntityLinkage::LinkageType::External: |
| 22 | return OS << "External"; |
| 23 | } |
| 24 | llvm_unreachable("Unhandled EntityLinkage::LinkageType variant"); |
| 25 | } |
| 26 | |
| 27 | llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, |
| 28 | const EntityLinkage &Linkage) { |
| 29 | return OS << "EntityLinkage("<< Linkage.getLinkage() << ")"; |
| 30 | } |
| 31 | |
| 32 | bool EntityLinkage::operator==(const EntityLinkage &Other) const { |
| 33 | return Linkage == Other.Linkage; |
| 34 | } |
| 35 | |
| 36 | bool EntityLinkage::operator!=(const EntityLinkage &Other) const { |
| 37 | return !(*this == Other); |
| 38 | } |
| 39 | |
| 40 | } // namespace clang::ssaf |
| 41 |