[PATCH] [compiler-rt] Symbolizer refactoring: ExtractToken and friends
Alexey Samsonov
vonosmas at gmail.com
Tue Feb 24 17:04:26 PST 2015
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:63
@@ -62,4 +62,3 @@
// delimiter char.
-static const char *ExtractToken(const char *str, const char *delims,
- char **result) {
+const char *ExtractToken(const char *str, const char *delims, char **result) {
uptr prefix_len = internal_strcspn(str, delims);
----------------
Can these function go to sanitizer_symbolizer.cc (or sanitizer_symbolizer_libcdep.cc)? They don't seem to be linux-specific.
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:86
@@ +85,3 @@
+// be multiple characters long.
+const char *ExtractTokenUpToDelimiter(const char *str, const char *delimiter,
+ char **result) {
----------------
Please add some unit tests for these functions to sanitizer_common/tests
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:571
@@ +570,3 @@
+ uptr line_number;
+ line_info = ExtractUptr(line_info, ":", &line_number);
+ info->line = line_number;
----------------
Please don't do this. If you want to remove `ExtractInt` in favor of `ExtractUptr`, please turn `AddressInfo::line` and `AddressInfo::column` into uptr in a separate change (and audit all cases where we use/print them). Another option is to have single `ExtractNumber<T>`, but then we'd need to provide definition for this function in a header, and I wouldn't like to include heavy sanitizer_allocator_internal.h in sanitizer_symbolizer.h
http://reviews.llvm.org/D7867
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list