[Sanitizer] Allow setting the report path to create directory
authorTeresa Johnson <tejohnson@google.com>
Tue, 14 Sep 2021 23:34:52 +0000 (16:34 -0700)
committerTeresa Johnson <tejohnson@google.com>
Tue, 21 Sep 2021 23:42:42 +0000 (16:42 -0700)
commit56dec4be9bd321a8fc0f19df00a8d63fc44813f5
tree981936d699b211263dcebaef33d8d763fda26bb0
parent22ea0cea595e1b44b46c520243f2292bc4e3d943
[Sanitizer] Allow setting the report path to create directory

When setting the report path, recursively create the directory as
needed. This brings the profile path support for memprof on par with
normal PGO. The code was largely cloned from __llvm_profile_recursive_mkdir
in compiler-rt/lib/profile/InstrProfilingUtil.c.

Differential Revision: https://reviews.llvm.org/D109794
compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cpp
compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
compiler-rt/lib/sanitizer_common/sanitizer_file.h
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp