Minor cleanup

move a function def to InstrProfilingUtil.c

llvm-svn: 262785
This commit is contained in:
Xinliang David Li 2016-03-06 00:55:20 +00:00
parent 40e1a71cdd
commit cf2f829be6
3 changed files with 15 additions and 12 deletions

View File

@ -34,3 +34,16 @@ void __llvm_profile_recursive_mkdir(char *path) {
path[i] = '/';
}
}
#if COMPILER_RT_HAS_ATOMICS != 1
COMPILER_RT_VISIBILITY
uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
void *R = *Ptr;
if (R == OldV) {
*Ptr = NewV;
return 1;
}
return 0;
}
#endif

View File

@ -20,4 +20,6 @@ void __llvm_profile_recursive_mkdir(char *Pathname);
static inline char *getenv(const char *name) { return NULL; }
#endif /* #if __PS4__ */
unsigned BoolCmpXchg(void **Ptr, void *OldV, void *NewV);
#endif /* PROFILE_INSTRPROFILINGUTIL_H */

View File

@ -25,18 +25,6 @@
return NULL; \
}
#if COMPILER_RT_HAS_ATOMICS != 1
COMPILER_RT_VISIBILITY
uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
void *R = *Ptr;
if (R == OldV) {
*Ptr = NewV;
return 1;
}
return 0;
}
#endif
/* This method is only used in value profiler mock testing. */
COMPILER_RT_VISIBILITY void
__llvm_profile_set_num_value_sites(__llvm_profile_data *Data,