================
@@ -0,0 +1,44 @@
+//===- EntityName.cpp -------------------------------------------*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/Scalable/Model/EntityName.h"
+
+namespace clang {
+namespace ssaf {
+
+EntityName::EntityName(llvm::StringRef USR, llvm::StringRef Suffix,
+ NestedBuildNamespace Namespace)
+ : USR(USR.str()), Suffix(Suffix), Namespace(std::move(Namespace)) {}
+
+bool EntityName::operator==(const EntityName& Other) const {
+ return USR == Other.USR &&
+ Suffix == Other.Suffix &&
+ Namespace == Other.Namespace;
+}
----------------
steakhal wrote:
What if we had a private `asTuple` member function and just call `asTuple() ==
Other.asTuple()` here?
Similarly in the `operator<`, calling `asTuple() < Other.asTuple()`?
```c++
auto asTuple() const { return std::tie(USR, Suffix, Namespace); }
```
Or something similar.
https://github.com/llvm/llvm-project/pull/169131
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits