Part of http://reviews.llvm.org/D7827. Removes ExtractInt and only leaves ExtractUptr. Makes these functions available in the sanitizer_symbolizer.h header. Adds ExtractTokenUpToDelimiter, which is currently unused, but I plan to use it for AtosSymbolizer later, and since it's related, I included it in this patch.
Details
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc | ||
---|---|---|
57–58 | Can these function go to sanitizer_symbolizer.cc (or sanitizer_symbolizer_libcdep.cc)? They don't seem to be linux-specific. | |
59 | Please add some unit tests for these functions to sanitizer_common/tests | |
543 | 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 |
Updating patch. Let's start with moving the functions, making them available in the header and adding tests.
LGTM, but please address comments.
lib/sanitizer_common/sanitizer_symbolizer.h | ||
---|---|---|
27 | Consider declaring these functions in sanitizer_symbolizer_internal.h instead (after you create it). | |
lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc | ||
20 | Remove comments, now that you have them in a header. | |
lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc | ||
25 | Here and below - "expected" result should go first, actual result should go second. | |
45 | E.g. this line should be EXPECT_EQ(123U, token); |
Consider declaring these functions in sanitizer_symbolizer_internal.h instead (after you create it).