1//===- EntityName.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/EntityName.h"
10
11namespace clang::ssaf {
12
13EntityName::EntityName(llvm::StringRef USR, llvm::StringRef Suffix,
14 NestedBuildNamespace Namespace)
15 : USR(USR.str()), Suffix(Suffix), Namespace(std::move(Namespace)) {}
16
17bool EntityName::operator==(const EntityName &Other) const {
18 return asTuple() == Other.asTuple();
19}
20
21bool EntityName::operator!=(const EntityName &Other) const {
22 return !(*this == Other);
23}
24
25bool EntityName::operator<(const EntityName &Other) const {
26 return asTuple() < Other.asTuple();
27}
28
29EntityName EntityName::makeQualified(NestedBuildNamespace Namespace) const {
30 auto Copy = *this;
31 Copy.Namespace = Copy.Namespace.makeQualified(Namespace);
32
33 return Copy;
34}
35
36} // namespace clang::ssaf
37