[Lldb-commits] [PATCH] D68609: Replace regex match with rfind (NFCish)

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 8 02:37:11 PDT 2019


labath added inline comments.


================
Comment at: lldb/source/Symbol/ObjectFile.cpp:85
         // Check for archive file with format "/path/to/archive.a(object.o)"
-        char path_with_object[PATH_MAX * 2];
-        module_sp->GetFileSpec().GetPath(path_with_object,
-                                         sizeof(path_with_object));
+        llvm::SmallString<PATH_MAX * 2> path_with_object;
+        module_sp->GetFileSpec().GetPath(path_with_object);
----------------
now that this is self-resizing, this can probably be something smaller (PATH_MAX on windows is 32k, sort of)..


================
Comment at: lldb/source/Symbol/ObjectFile.cpp:577
+  size_t len = path_with_object.size();
+  if (len < 2 || path_with_object[len-1] != ')')
+    return false;
----------------
`.back()` ?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68609/new/

https://reviews.llvm.org/D68609





More information about the lldb-commits mailing list