summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-03-06 00:55:20 +0000
committerXinliang David Li <davidxl@google.com>2016-03-06 00:55:20 +0000
commitd903a578b4b2a00732dee763753c22f35bb04b89 (patch)
treefd0ff1af728d20bbee1269e66825b3462666d039 /lib
parente3e346be2f4b629db67037023f83df7e0bd058ba (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')
-rw-r--r--lib/profile/InstrProfilingUtil.c13
-rw-r--r--lib/profile/InstrProfilingUtil.h2
-rw-r--r--lib/profile/InstrProfilingValue.c12
3 files changed, 15 insertions, 12 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
+
diff --git a/lib/profile/InstrProfilingUtil.h b/lib/profile/InstrProfilingUtil.h
index 77941e0b4..a7c9b53ee 100644
--- a/lib/profile/InstrProfilingUtil.h
+++ b/lib/profile/InstrProfilingUtil.h
@@ -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 */
diff --git a/lib/profile/InstrProfilingValue.c b/lib/profile/InstrProfilingValue.c
index 7b36f9fa9..4b4c82e80 100644
--- a/lib/profile/InstrProfilingValue.c
+++ b/lib/profile/InstrProfilingValue.c
@@ -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,