alexfh requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: clang-rename/USRFindingAction.cpp:145
@@ +144,3 @@
+  explicit NamedDeclFindingConsumer(
+      ArrayRef<unsigned> SymbolOffsets,
+      ArrayRef<std::string> OldNames,
----------------
What about the second part?

> BTW, if the code relies on `SymbolOffsets` and `OldNames` being of the same 
> length, maybe a single collection of pairs would work better? Or define a 
> structure for keeping offset and old name together?

================
Comment at: clang-rename/USRFindingAction.h:37-40
@@ -37,6 +36,6 @@
 private:
-  unsigned SymbolOffset;
-  std::string OldName;
-  std::string SpellingName;
-  std::vector<std::string> USRs;
+  ArrayRef<unsigned> SymbolOffsets;
+  ArrayRef<std::string> OldNames;
+  std::vector<std::string> SpellingNames;
+  std::vector<std::vector<std::string>> USRList;
 };
----------------
Yes, I think, copying here makes sense to uncouple lifetime of the creator of 
the class with the lifetime of this class.


https://reviews.llvm.org/D23651



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to