aboutsummaryrefslogtreecommitdiffstats
path: root/lib/profile/InstrProfilingUtil.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:19 +0000
commit005b7ed8f76756d94ef6266ded755ab7863cb936 (patch)
treede2aa8f0c2f604d3b4f81a94dd20ea0c50bf1e68 /lib/profile/InstrProfilingUtil.c
parent93c1b73a09a52d4a265f683bf1954b08bb430049 (diff)
downloadsrc-005b7ed8f76756d94ef6266ded755ab7863cb936.tar.gz
src-005b7ed8f76756d94ef6266ded755ab7863cb936.zip
Vendor import of compiler-rt trunk r338536:vendor/compiler-rt/compiler-rt-trunk-r338536
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=337141 svn path=/vendor/compiler-rt/compiler-rt-trunk-r338536/; revision=337142; tag=vendor/compiler-rt/compiler-rt-trunk-r338536
Diffstat (limited to 'lib/profile/InstrProfilingUtil.c')
-rw-r--r--lib/profile/InstrProfilingUtil.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingUtil.c b/lib/profile/InstrProfilingUtil.c
index d053ab160ca7..083bf14a3260 100644
--- a/lib/profile/InstrProfilingUtil.c
+++ b/lib/profile/InstrProfilingUtil.c
@@ -35,6 +35,8 @@
#include "InstrProfiling.h"
#include "InstrProfilingUtil.h"
+COMPILER_RT_WEAK unsigned lprofDirMode = 0755;
+
COMPILER_RT_VISIBILITY
void __llvm_profile_recursive_mkdir(char *path) {
int i;
@@ -47,12 +49,19 @@ void __llvm_profile_recursive_mkdir(char *path) {
#ifdef _WIN32
_mkdir(path);
#else
- mkdir(path, 0755); /* Some of these will fail, ignore it. */
+ /* Some of these will fail, ignore it. */
+ mkdir(path, __llvm_profile_get_dir_mode());
#endif
path[i] = save;
}
}
+COMPILER_RT_VISIBILITY
+void __llvm_profile_set_dir_mode(unsigned Mode) { lprofDirMode = Mode; }
+
+COMPILER_RT_VISIBILITY
+unsigned __llvm_profile_get_dir_mode(void) { return lprofDirMode; }
+
#if COMPILER_RT_HAS_ATOMICS != 1
COMPILER_RT_VISIBILITY
uint32_t lprofBoolCmpXchg(void **Ptr, void *OldV, void *NewV) {