summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingUtil.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-05-16 23:01:03 +0000
committerXinliang David Li <davidxl@google.com>2016-05-16 23:01:03 +0000
commite3e27c07259bbfe1cc4615ad518f51d143cda0cc (patch)
tree601ce8793a7b841d774615864f7f1d38db6f464f /lib/profile/InstrProfilingUtil.c
parentc87f7410a648527864dee5c0c887a4ecaa09579a (diff)
[profile] Add portability macro for atomic fetch_and_add
This is another enabler patch to support value profiling without dynamic memory allocation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingUtil.c')
-rw-r--r--lib/profile/InstrProfilingUtil.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/profile/InstrProfilingUtil.c b/lib/profile/InstrProfilingUtil.c
index 04bdb3e4c..eb79d4222 100644
--- a/lib/profile/InstrProfilingUtil.c
+++ b/lib/profile/InstrProfilingUtil.c
@@ -51,6 +51,13 @@ uint32_t lprofBoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
}
return 0;
}
+COMPILER_RT_VISIBILITY
+void *lprofPtrFetchAdd(void **Mem, long ByteIncr) {
+ void *Old = *Mem;
+ *((char **)Mem) += ByteIncr;
+ return Old;
+}
+
#endif
#ifdef COMPILER_RT_HAS_UNAME