[scudo][standalone] Add string utility functions
authorKostya Kortchinsky <kostyak@google.com>
Tue, 19 Mar 2019 14:47:05 +0000 (14:47 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Tue, 19 Mar 2019 14:47:05 +0000 (14:47 +0000)
commit7045c6f0b5a79a8866824b2579a22151eb4dde69
tree3c9da6ca6afd0a9d801fe571962adc1a89b63f77
parent8ee477a2ab6a9dc184359e634c91925ea347888f
[scudo][standalone] Add string utility functions

Summary:
Add some string utility functions, notably to format strings, get
lengths, convert a string to a number. Those functions will be
used in reports and flags (coming up next). They were mostly borrowed
from sanitizer_common.

Make use of the string length function in a couple places in the
platform code that was checked in with inlined version of it.

Add some tests.

Reviewers: morehouse, eugenis, vitalybuka, hctim

Reviewed By: morehouse, vitalybuka

Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D59262

llvm-svn: 356457
compiler-rt/lib/scudo/standalone/CMakeLists.txt
compiler-rt/lib/scudo/standalone/fuchsia.cc
compiler-rt/lib/scudo/standalone/linux.cc
compiler-rt/lib/scudo/standalone/string_utils.cc [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/string_utils.h [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
compiler-rt/lib/scudo/standalone/tests/strings_test.cc [new file with mode: 0644]