Minor cleanup
authorXinliang David Li <davidxl@google.com>
Sun, 6 Mar 2016 00:55:20 +0000 (00:55 +0000)
committerXinliang David Li <davidxl@google.com>
Sun, 6 Mar 2016 00:55:20 +0000 (00:55 +0000)
move a function def to InstrProfilingUtil.c

llvm-svn: 262785

compiler-rt/lib/profile/InstrProfilingUtil.c
compiler-rt/lib/profile/InstrProfilingUtil.h
compiler-rt/lib/profile/InstrProfilingValue.c

index 6f0443d3bb5dfcf639657ea7ad49a014d5735da9..b7892d841f15ee7c523aa7a6abfd6eff52f5c67d 100644 (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
+
index 77941e0b4eaf4dafeb99193fcfab892eb6c4208c..a7c9b53eeece21987b9c4507d7bb69bd41e5b662 100644 (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 */
index 7b36f9fa93b33d3430d8187f493b0ba452b17fc0..4b4c82e808185f3cf660647b08c8510735f4fffa 100644 (file)
     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,