Debian Codegraph @

clang/lib/Analysis/Scalable/Model/EntityName.cpp

raw
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
11 namespace clang::ssaf {
12
13 EntityName::EntityName(llvm::StringRef USR, llvm::StringRef Suffix,
14 NestedBuildNamespace Namespace)
15 : USR(USR.str()), Suffix(Suffix), Namespace(std::move(Namespace)) {}
16
17 bool EntityName::operator==(const EntityName &Other) const {
18 return asTuple() == Other.asTuple();
19 }
20
21 bool EntityName::operator!=(const EntityName &Other) const {
22 return !(*this == Other);
23 }
24
25 bool EntityName::operator<(const EntityName &Other) const {
26 return asTuple() < Other.asTuple();
27 }
28
29 EntityName 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