[PATCH] [compiler-rt] Symbolizer refactoring: ExtractToken and friends

Alexey Samsonov vonosmas at gmail.com
Mon Mar 2 12:12:52 PST 2015


LGTM, but please address comments.


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer.h:27
@@ -26,1 +26,3 @@
 
+// Parsing helpers, 'str' is searched for delimiter(s) and a string or uptr
+// is extracted. When extracting a string, a newly allocated (using
----------------
Consider declaring these functions in sanitizer_symbolizer_internal.h instead (after you create it).

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc:20
@@ -18,1 +19,3 @@
 
+// Extracts the prefix of "str" that consists of any characters not
+// present in "delims" string, and copies this prefix to "result", allocating
----------------
Remove comments, now that you have them in a header.

================
Comment at: lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc:25
@@ +24,3 @@
+  rest = ExtractToken("a;b;c", ";", &token);
+  EXPECT_STREQ(token, "a");
+  EXPECT_STREQ(rest, "b;c");
----------------
Here and below - "expected" result should go first, actual result should go second.

================
Comment at: lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc:45
@@ +44,3 @@
+  const char *rest = ExtractUptr("123,456;789", ";,", &token);
+  EXPECT_EQ(token, (uptr)123);
+  EXPECT_STREQ(rest, "456;789");
----------------
E.g. this line should be
  EXPECT_EQ(123U, token);

http://reviews.llvm.org/D7867

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list