[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 05:04:07 PST 2024


================
@@ -746,6 +812,30 @@ void findNearMiss(
 
 } // namespace
 
+SymbolRange::SymbolRange(Range R) : Ranges({R}) {}
+
+SymbolRange::SymbolRange(std::vector<Range> Ranges)
+    : Ranges(std::move(Ranges)) {}
+
+Range SymbolRange::range() const { return Ranges.front(); }
+
+bool operator==(const SymbolRange &LHS, const SymbolRange &RHS) {
+  return LHS.Ranges == RHS.Ranges;
+}
+bool operator!=(const SymbolRange &LHS, const SymbolRange &RHS) {
+  return !(LHS == RHS);
+}
+bool operator<(const SymbolRange &LHS, const SymbolRange &RHS) {
+  return LHS.range() < RHS.range();
+}
+
+std::vector<SymbolRange> symbolRanges(const std::vector<Range> Ranges) {
----------------
kadircet wrote:

can we take in `llvm::ArrayRef<Range> Ranges`, also move it to renametests, i don't think it's used elswhere

https://github.com/llvm/llvm-project/pull/76466


More information about the cfe-commits mailing list