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 | ||
---|---|---|
63 | Can these function go to sanitizer_symbolizer.cc (or sanitizer_symbolizer_libcdep.cc)? They don't seem to be linux-specific. | |
86 | Please add some unit tests for these functions to sanitizer_common/tests | |
571 | 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 ↗ | (On Diff #20955) | Remove comments, now that you have them in a header. |
lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc | ||
25 ↗ | (On Diff #20955) | Here and below - "expected" result should go first, actual result should go second. |
45 ↗ | (On Diff #20955) | E.g. this line should be EXPECT_EQ(123U, token); |
Consider declaring these functions in sanitizer_symbolizer_internal.h instead (after you create it).