diff options
author | Xinliang David Li <davidxl@google.com> | 2016-03-06 00:55:20 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-03-06 00:55:20 +0000 |
commit | d903a578b4b2a00732dee763753c22f35bb04b89 (patch) | |
tree | fd0ff1af728d20bbee1269e66825b3462666d039 /lib/profile/InstrProfilingUtil.c | |
parent | e3e346be2f4b629db67037023f83df7e0bd058ba (diff) |
Minor cleanup
move a function def to InstrProfilingUtil.c
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingUtil.c')
-rw-r--r-- | lib/profile/InstrProfilingUtil.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/profile/InstrProfilingUtil.c b/lib/profile/InstrProfilingUtil.c index 6f0443d3b..b7892d841 100644 --- a/lib/profile/InstrProfilingUtil.c +++ b/lib/profile/InstrProfilingUtil.c @@ -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 + |