[PATCH] D17738: [NVPTX] Fix function identifiers that are invalid in PTX and a bug fix for the case of name collisions.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 14:15:49 PST 2016


jlebar added inline comments.

================
Comment at: lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp:40
@@ -39,1 +39,3 @@
   std::string cleanUpName(StringRef Name);
+  /// \brief Set a clean name ensuring collisions are avoided.
+  void generateCleanName(Value &V);
----------------
Nit: "name, ensuring", since the gerund phrase is an appositive.

================
Comment at: lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp:74
@@ +73,3 @@
+  while (1) {
+    StringRef ValidName = cleanUpName(V.getName());
+    // setName doesn't do extra work if the name does not change.
----------------
cleanUpName returns a string -- isn't this a dangling pointer?


http://reviews.llvm.org/D17738





More information about the llvm-commits mailing list