Move lifetime_annotations to namespace clang::tidy::lifetimes.
We're planning to upstream this to Clang-Tidy eventually, and we're already
preparing for that.
PiperOrigin-RevId: 442730445
diff --git a/lifetime_annotations/function_lifetimes.cc b/lifetime_annotations/function_lifetimes.cc
index 560ec38..2e74cb6 100644
--- a/lifetime_annotations/function_lifetimes.cc
+++ b/lifetime_annotations/function_lifetimes.cc
@@ -16,7 +16,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/SmallVector.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
// Track a bijective mapping between 2 sets of Lifetimes.
@@ -237,4 +239,6 @@
return os << func_lifetimes.DebugString();
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/function_lifetimes.h b/lifetime_annotations/function_lifetimes.h
index b1528c5..f3dd592 100644
--- a/lifetime_annotations/function_lifetimes.h
+++ b/lifetime_annotations/function_lifetimes.h
@@ -18,7 +18,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringRef.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// Interface used to create lifetimes in FunctionLifetimes::CreateForDecl.
// CreateReturnLifetime will be called with the ValueLifetimes that were created
@@ -160,6 +162,8 @@
using FunctionLifetimesOrError =
std::variant<FunctionAnalysisError, FunctionLifetimes>;
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_FUNCTION_LIFETIMES_H_
diff --git a/lifetime_annotations/lifetime.cc b/lifetime_annotations/lifetime.cc
index 1652215..f088461 100644
--- a/lifetime_annotations/lifetime.cc
+++ b/lifetime_annotations/lifetime.cc
@@ -6,7 +6,9 @@
#include "third_party/absl/strings/str_cat.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
constexpr int INVALID_LIFETIME_ID_EMPTY = 0;
constexpr int INVALID_LIFETIME_ID_TOMBSTONE = 1;
@@ -79,4 +81,6 @@
return os << lifetime.DebugString();
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime.h b/lifetime_annotations/lifetime.h
index bce28fa..a09979d 100644
--- a/lifetime_annotations/lifetime.h
+++ b/lifetime_annotations/lifetime.h
@@ -14,7 +14,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/Hashing.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// A lifetime variable or constant lifetime.
class Lifetime {
@@ -81,26 +83,28 @@
std::ostream& operator<<(std::ostream& os, Lifetime lifetime);
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
namespace llvm {
template <>
-struct DenseMapInfo<devtools_rust::Lifetime, void> {
- static devtools_rust::Lifetime getEmptyKey() {
- return devtools_rust::Lifetime::InvalidEmpty();
+struct DenseMapInfo<clang::tidy::lifetimes::Lifetime, void> {
+ static clang::tidy::lifetimes::Lifetime getEmptyKey() {
+ return clang::tidy::lifetimes::Lifetime::InvalidEmpty();
}
- static devtools_rust::Lifetime getTombstoneKey() {
- return devtools_rust::Lifetime::InvalidTombstone();
+ static clang::tidy::lifetimes::Lifetime getTombstoneKey() {
+ return clang::tidy::lifetimes::Lifetime::InvalidTombstone();
}
- static unsigned getHashValue(devtools_rust::Lifetime lifetime) {
+ static unsigned getHashValue(clang::tidy::lifetimes::Lifetime lifetime) {
return llvm::hash_value(lifetime.id_);
}
- static bool isEqual(devtools_rust::Lifetime lhs,
- devtools_rust::Lifetime rhs) {
+ static bool isEqual(clang::tidy::lifetimes::Lifetime lhs,
+ clang::tidy::lifetimes::Lifetime rhs) {
return lhs.id_ == rhs.id_;
}
};
@@ -110,9 +114,9 @@
namespace std {
template <>
-struct less<devtools_rust::Lifetime> {
- bool operator()(const devtools_rust::Lifetime& l1,
- const devtools_rust::Lifetime& l2) const {
+struct less<clang::tidy::lifetimes::Lifetime> {
+ bool operator()(const clang::tidy::lifetimes::Lifetime& l1,
+ const clang::tidy::lifetimes::Lifetime& l2) const {
return l1.id_ < l2.id_;
}
};
diff --git a/lifetime_annotations/lifetime_annotations.cc b/lifetime_annotations/lifetime_annotations.cc
index 3871388..94d46e4 100644
--- a/lifetime_annotations/lifetime_annotations.cc
+++ b/lifetime_annotations/lifetime_annotations.cc
@@ -32,7 +32,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringRef.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
llvm::Expected<FunctionLifetimes> ParseLifetimeAnnotations(
@@ -324,4 +326,6 @@
return args;
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_annotations.h b/lifetime_annotations/lifetime_annotations.h
index b3b4e57..2bb4054 100644
--- a/lifetime_annotations/lifetime_annotations.h
+++ b/lifetime_annotations/lifetime_annotations.h
@@ -13,7 +13,9 @@
#include "third_party/llvm/llvm-project/clang/include/clang/Frontend/CompilerInstance.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// Context that is required to obtain lifetime annotations for a function.
struct LifetimeAnnotationContext {
@@ -61,6 +63,8 @@
llvm::SmallVector<llvm::SmallVector<clang::TypeLoc>> GetTemplateArgs(
clang::TypeLoc type_loc);
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_LIFETIME_ANNOTATIONS_H_
diff --git a/lifetime_annotations/lifetime_annotations_test.cc b/lifetime_annotations/lifetime_annotations_test.cc
index 8a2fded..a6dd6e2 100644
--- a/lifetime_annotations/lifetime_annotations_test.cc
+++ b/lifetime_annotations/lifetime_annotations_test.cc
@@ -15,7 +15,9 @@
#include "third_party/llvm/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/FormatVariadic.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
using testing::StartsWith;
@@ -465,4 +467,6 @@
}
} // namespace
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_substitutions.cc b/lifetime_annotations/lifetime_substitutions.cc
index 113b2e0..645e6d0 100644
--- a/lifetime_annotations/lifetime_substitutions.cc
+++ b/lifetime_annotations/lifetime_substitutions.cc
@@ -9,7 +9,9 @@
#include "third_party/absl/strings/str_join.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/raw_ostream.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
void LifetimeSubstitutions::Add(Lifetime variable, Lifetime substitution) {
assert(variable.IsVariable());
@@ -47,4 +49,6 @@
llvm::errs() << absl::StrJoin(parts, ", ") << "\n";
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_substitutions.h b/lifetime_annotations/lifetime_substitutions.h
index 0f71bb3..d9a8682 100644
--- a/lifetime_annotations/lifetime_substitutions.h
+++ b/lifetime_annotations/lifetime_substitutions.h
@@ -8,7 +8,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/DenseMap.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/Hashing.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// A set of substitutions of a lifetime variable with another lifetime (variable
// or constant).
@@ -34,6 +36,8 @@
llvm::DenseMap<Lifetime, Lifetime> substitutions_;
};
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_LIFETIME_SUBSTITUTIONS_H_
diff --git a/lifetime_annotations/lifetime_substitutions_test.cc b/lifetime_annotations/lifetime_substitutions_test.cc
index 7faac17..50f5e0a 100644
--- a/lifetime_annotations/lifetime_substitutions_test.cc
+++ b/lifetime_annotations/lifetime_substitutions_test.cc
@@ -6,7 +6,9 @@
#include "testing/base/public/gmock.h"
#include "testing/base/public/gunit.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
TEST(LifetimeSubstitutions, EmptySubstitution) {
@@ -94,4 +96,6 @@
}
} // namespace
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_symbol_table.cc b/lifetime_annotations/lifetime_symbol_table.cc
index e17f7cd..0892dde 100644
--- a/lifetime_annotations/lifetime_symbol_table.cc
+++ b/lifetime_annotations/lifetime_symbol_table.cc
@@ -10,7 +10,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/ErrorHandling.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
std::optional<Lifetime> LifetimeSymbolTable::LookupName(
llvm::StringRef name) const {
@@ -112,4 +114,6 @@
iter->second = lifetime;
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_symbol_table.h b/lifetime_annotations/lifetime_symbol_table.h
index 60d3ea5..9a8712b 100644
--- a/lifetime_annotations/lifetime_symbol_table.h
+++ b/lifetime_annotations/lifetime_symbol_table.h
@@ -13,7 +13,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringMap.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringRef.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// One-to-one mapping between lifetime names and the corresponding lifetimes.
class LifetimeSymbolTable {
@@ -64,6 +66,8 @@
int next_name_index_ = 0;
};
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_LIFETIME_SYMBOL_TABLE_H_
diff --git a/lifetime_annotations/lifetime_symbol_table_test.cc b/lifetime_annotations/lifetime_symbol_table_test.cc
index a3f3bd5..ec12be3 100644
--- a/lifetime_annotations/lifetime_symbol_table_test.cc
+++ b/lifetime_annotations/lifetime_symbol_table_test.cc
@@ -6,7 +6,9 @@
#include "testing/base/public/gunit.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
TEST(LifetimeSymbolTableTest, Static) {
@@ -80,4 +82,6 @@
}
} // namespace
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/lifetime_test.cc b/lifetime_annotations/lifetime_test.cc
index a13a045..171de16 100644
--- a/lifetime_annotations/lifetime_test.cc
+++ b/lifetime_annotations/lifetime_test.cc
@@ -7,7 +7,9 @@
#include "testing/base/public/gmock.h"
#include "testing/base/public/gunit.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
TEST(Lifetime, IsVariable) {
@@ -58,4 +60,6 @@
}
} // namespace
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/pointee_type.cc b/lifetime_annotations/pointee_type.cc
index 3121014..f33d48b 100644
--- a/lifetime_annotations/pointee_type.cc
+++ b/lifetime_annotations/pointee_type.cc
@@ -4,7 +4,9 @@
#include "lifetime_annotations/pointee_type.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
clang::QualType PointeeType(clang::QualType type) {
if (auto ptr_type = type->getAs<clang::PointerType>()) {
@@ -16,4 +18,6 @@
return clang::QualType();
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/pointee_type.h b/lifetime_annotations/pointee_type.h
index 3197b3d..fe61f3f 100644
--- a/lifetime_annotations/pointee_type.h
+++ b/lifetime_annotations/pointee_type.h
@@ -7,7 +7,9 @@
#include "third_party/llvm/llvm-project/clang/include/clang/AST/Type.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// If `type` is a pointer or reference type, returns the type of its pointee.
// Otherwise, returns a null type.
@@ -18,6 +20,8 @@
// lifetimes for it".
clang::QualType PointeeType(clang::QualType type);
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_POINTEE_TYPE_H_
diff --git a/lifetime_annotations/test/named_func_lifetimes.cc b/lifetime_annotations/test/named_func_lifetimes.cc
index bb5e664..2fb74c8 100644
--- a/lifetime_annotations/test/named_func_lifetimes.cc
+++ b/lifetime_annotations/test/named_func_lifetimes.cc
@@ -10,7 +10,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/DenseMap.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
std::string NameLifetimes(const FunctionLifetimes& func_lifetimes) {
LifetimeSymbolTable symbol_table;
@@ -133,4 +135,6 @@
return LifetimesContainMatcher(std::move(expected));
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/test/named_func_lifetimes.h b/lifetime_annotations/test/named_func_lifetimes.h
index 24f1497..e0f6e8f 100644
--- a/lifetime_annotations/test/named_func_lifetimes.h
+++ b/lifetime_annotations/test/named_func_lifetimes.h
@@ -20,7 +20,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/FormatVariadic.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/raw_ostream.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// Returns a human-readable representation of `func_lifetimes` that uses
// alphabetic names for lifetimes.
@@ -89,6 +91,8 @@
testing::Matcher<NamedFuncLifetimes> LifetimesContain(
NamedFuncLifetimes expected);
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_TEST_NAMED_FUNC_LIFETIMES_H_
diff --git a/lifetime_annotations/test/run_on_code.cc b/lifetime_annotations/test/run_on_code.cc
index 09a402d..5c0ea51 100644
--- a/lifetime_annotations/test/run_on_code.cc
+++ b/lifetime_annotations/test/run_on_code.cc
@@ -9,7 +9,9 @@
#include "lifetime_annotations/lifetime_annotations.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
namespace {
@@ -68,4 +70,6 @@
std::make_shared<clang::PCHContainerOperations>(), file_contents);
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
diff --git a/lifetime_annotations/test/run_on_code.h b/lifetime_annotations/test/run_on_code.h
index 9a2569e..82eec2e 100644
--- a/lifetime_annotations/test/run_on_code.h
+++ b/lifetime_annotations/test/run_on_code.h
@@ -14,7 +14,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/ArrayRef.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringRef.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
bool runOnCodeWithLifetimeHandlers(
llvm::StringRef code,
@@ -24,6 +26,8 @@
const clang::tooling::FileContentMappings& file_contents =
clang::tooling::FileContentMappings());
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
#endif // CRUBIT_LIFETIME_ANNOTATIONS_TEST_RUN_ON_CODE_H_
diff --git a/lifetime_annotations/type_lifetimes.cc b/lifetime_annotations/type_lifetimes.cc
index cb82bc0..84139de 100644
--- a/lifetime_annotations/type_lifetimes.cc
+++ b/lifetime_annotations/type_lifetimes.cc
@@ -33,7 +33,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/ErrorHandling.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
llvm::SmallVector<std::string> GetLifetimeParameters(clang::QualType type) {
// TODO(mboehme):
@@ -616,13 +618,15 @@
return strlit->getString();
}
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
namespace llvm {
-bool DenseMapInfo<devtools_rust::ValueLifetimes>::isEqual(
- const devtools_rust::ValueLifetimes& lhs,
- const devtools_rust::ValueLifetimes& rhs) {
+bool DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>::isEqual(
+ const clang::tidy::lifetimes::ValueLifetimes& lhs,
+ const clang::tidy::lifetimes::ValueLifetimes& rhs) {
if (lhs.type_ != rhs.type_) {
return false;
}
@@ -631,7 +635,7 @@
return false;
}
if (lhs.pointee_lifetimes_ &&
- !DenseMapInfo<devtools_rust::ObjectLifetimes>::isEqual(
+ !DenseMapInfo<clang::tidy::lifetimes::ObjectLifetimes>::isEqual(
*lhs.pointee_lifetimes_, *rhs.pointee_lifetimes_)) {
return false;
}
@@ -662,11 +666,11 @@
return true;
}
-unsigned DenseMapInfo<devtools_rust::ValueLifetimes>::getHashValue(
- const devtools_rust::ValueLifetimes& value_lifetimes) {
+unsigned DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>::getHashValue(
+ const clang::tidy::lifetimes::ValueLifetimes& value_lifetimes) {
llvm::hash_code hash = 0;
if (value_lifetimes.pointee_lifetimes_) {
- hash = DenseMapInfo<devtools_rust::ObjectLifetimes>::getHashValue(
+ hash = DenseMapInfo<clang::tidy::lifetimes::ObjectLifetimes>::getHashValue(
*value_lifetimes.pointee_lifetimes_);
}
for (const auto& lifetimes_at_depth :
@@ -681,9 +685,9 @@
value_lifetimes.lifetime_parameters_by_name_.GetMapping()) {
hash = hash_combine(hash, DenseMapInfo<llvm::StringRef>::getHashValue(
lifetime_arg.first()));
- hash =
- hash_combine(hash, DenseMapInfo<devtools_rust::Lifetime>::getHashValue(
- lifetime_arg.second));
+ hash = hash_combine(
+ hash, DenseMapInfo<clang::tidy::lifetimes::Lifetime>::getHashValue(
+ lifetime_arg.second));
}
return hash_combine(
hash, DenseMapInfo<clang::QualType>::getHashValue(value_lifetimes.type_));
diff --git a/lifetime_annotations/type_lifetimes.h b/lifetime_annotations/type_lifetimes.h
index 206f92b..4f0e93b 100644
--- a/lifetime_annotations/type_lifetimes.h
+++ b/lifetime_annotations/type_lifetimes.h
@@ -22,7 +22,9 @@
#include "third_party/llvm/llvm-project/llvm/include/llvm/ADT/StringRef.h"
#include "third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h"
-namespace devtools_rust {
+namespace clang {
+namespace tidy {
+namespace lifetimes {
// Returns a lifetime in some human-readable format.
using LifetimeFormatter = std::function<std::string(Lifetime)>;
@@ -178,7 +180,7 @@
// string_view (this mapping is tracked by lifetime_parameters_by_name_).
LifetimeSymbolTable lifetime_parameters_by_name_;
- friend class llvm::DenseMapInfo<devtools_rust::ValueLifetimes>;
+ friend class llvm::DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>;
};
// Represents all the lifetimes of an object. The object itself always has
@@ -252,7 +254,7 @@
clang::QualType type, llvm::SmallVector<std::string> type_lifetime_args,
llvm::StringRef object_lifetime_parameter) const;
- friend class llvm::DenseMapInfo<devtools_rust::ObjectLifetimes>;
+ friend class llvm::DenseMapInfo<clang::tidy::lifetimes::ObjectLifetimes>;
Lifetime lifetime_;
ValueLifetimes value_lifetimes_;
};
@@ -274,58 +276,63 @@
llvm::Expected<llvm::StringRef> EvaluateAsStringLiteral(
const clang::Expr* expr, const clang::ASTContext& ast_context);
-} // namespace devtools_rust
+} // namespace lifetimes
+} // namespace tidy
+} // namespace clang
namespace llvm {
template <>
-struct DenseMapInfo<devtools_rust::ValueLifetimes> {
- static devtools_rust::ValueLifetimes getEmptyKey() {
- return devtools_rust::ValueLifetimes(
+struct DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes> {
+ static clang::tidy::lifetimes::ValueLifetimes getEmptyKey() {
+ return clang::tidy::lifetimes::ValueLifetimes(
DenseMapInfo<clang::QualType>().getEmptyKey());
}
- static devtools_rust::ValueLifetimes getTombstoneKey() {
- return devtools_rust::ValueLifetimes(
+ static clang::tidy::lifetimes::ValueLifetimes getTombstoneKey() {
+ return clang::tidy::lifetimes::ValueLifetimes(
DenseMapInfo<clang::QualType>().getTombstoneKey());
}
- static bool isEqual(const devtools_rust::ValueLifetimes& lhs,
- const devtools_rust::ValueLifetimes& rhs);
+ static bool isEqual(const clang::tidy::lifetimes::ValueLifetimes& lhs,
+ const clang::tidy::lifetimes::ValueLifetimes& rhs);
static unsigned getHashValue(
- const devtools_rust::ValueLifetimes& value_lifetimes);
+ const clang::tidy::lifetimes::ValueLifetimes& value_lifetimes);
};
template <>
-struct DenseMapInfo<devtools_rust::ObjectLifetimes> {
- static devtools_rust::ObjectLifetimes getEmptyKey() {
- return devtools_rust::ObjectLifetimes(
- DenseMapInfo<devtools_rust::Lifetime>().getEmptyKey(),
- DenseMapInfo<devtools_rust::ValueLifetimes>().getEmptyKey());
+struct DenseMapInfo<clang::tidy::lifetimes::ObjectLifetimes> {
+ static clang::tidy::lifetimes::ObjectLifetimes getEmptyKey() {
+ return clang::tidy::lifetimes::ObjectLifetimes(
+ DenseMapInfo<clang::tidy::lifetimes::Lifetime>().getEmptyKey(),
+ DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>().getEmptyKey());
}
- static devtools_rust::ObjectLifetimes getTombstoneKey() {
- return devtools_rust::ObjectLifetimes(
- DenseMapInfo<devtools_rust::Lifetime>().getTombstoneKey(),
- DenseMapInfo<devtools_rust::ValueLifetimes>().getTombstoneKey());
+ static clang::tidy::lifetimes::ObjectLifetimes getTombstoneKey() {
+ return clang::tidy::lifetimes::ObjectLifetimes(
+ DenseMapInfo<clang::tidy::lifetimes::Lifetime>().getTombstoneKey(),
+ DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>()
+ .getTombstoneKey());
}
- static bool isEqual(const devtools_rust::ObjectLifetimes& lhs,
- const devtools_rust::ObjectLifetimes& rhs) {
- return DenseMapInfo<devtools_rust::Lifetime>::isEqual(lhs.lifetime_,
- rhs.lifetime_) &&
- DenseMapInfo<devtools_rust::ValueLifetimes>::isEqual(
+ static bool isEqual(const clang::tidy::lifetimes::ObjectLifetimes& lhs,
+ const clang::tidy::lifetimes::ObjectLifetimes& rhs) {
+ return DenseMapInfo<clang::tidy::lifetimes::Lifetime>::isEqual(
+ lhs.lifetime_, rhs.lifetime_) &&
+ DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>::isEqual(
lhs.value_lifetimes_, rhs.value_lifetimes_);
}
static unsigned getHashValue(
- const devtools_rust::ObjectLifetimes& object_lifetimes) {
- unsigned hash = DenseMapInfo<devtools_rust::Lifetime>::getHashValue(
- object_lifetimes.lifetime_);
+ const clang::tidy::lifetimes::ObjectLifetimes& object_lifetimes) {
+ unsigned hash =
+ DenseMapInfo<clang::tidy::lifetimes::Lifetime>::getHashValue(
+ object_lifetimes.lifetime_);
return hash_combine(
- hash, DenseMapInfo<devtools_rust::ValueLifetimes>::getHashValue(
- object_lifetimes.value_lifetimes_));
+ hash,
+ DenseMapInfo<clang::tidy::lifetimes::ValueLifetimes>::getHashValue(
+ object_lifetimes.value_lifetimes_));
}
};