diff options
author | Xinliang David Li <davidxl@google.com> | 2019-06-06 06:35:18 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2019-06-06 06:35:18 +0000 |
commit | c1867557d93d622f761b57af6e66e3e518bc0b9f (patch) | |
tree | 72685a8c1a95676d892d7093ff13c08cd085c751 /compiler-rt/lib/profile/InstrProfilingUtil.c | |
parent | 9226ba6b376ea2a221e97c2f674841a496869f4d (diff) | |
download | bcm5719-llvm-c1867557d93d622f761b57af6e66e3e518bc0b9f.tar.gz bcm5719-llvm-c1867557d93d622f761b57af6e66e3e518bc0b9f.zip |
[Profile]: Add runtime interface to specify file handle for profile data.
Author: Sajjad Mirza
Differential Revision: http://reviews.llvm.org/D62541
llvm-svn: 362676
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingUtil.c')
-rw-r--r-- | compiler-rt/lib/profile/InstrProfilingUtil.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingUtil.c b/compiler-rt/lib/profile/InstrProfilingUtil.c index 5e479ae7150..02d100792db 100644 --- a/compiler-rt/lib/profile/InstrProfilingUtil.c +++ b/compiler-rt/lib/profile/InstrProfilingUtil.c @@ -154,6 +154,26 @@ COMPILER_RT_VISIBILITY int lprofUnlockFd(int fd) { #endif } +COMPILER_RT_VISIBILITY int lprofLockFileHandle(FILE *F) { + int fd; +#if defined(_WIN32) + fd = _fileno(F); +#else + fd = fileno(F); +#endif + return lprofLockFd(fd); +} + +COMPILER_RT_VISIBILITY int lprofUnlockFileHandle(FILE *F) { + int fd; +#if defined(_WIN32) + fd = _fileno(F); +#else + fd = fileno(F); +#endif + return lprofUnlockFd(fd); +} + COMPILER_RT_VISIBILITY FILE *lprofOpenFileEx(const char *ProfileName) { FILE *f; int fd; |