150
|
1 /*
|
|
2 * tsan_annotations.cpp -- ThreadSanitizer annotations to support data
|
|
3 * race detection in OpenMP programs.
|
|
4 */
|
|
5
|
|
6 //===----------------------------------------------------------------------===//
|
|
7 //
|
|
8 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
9 // See https://llvm.org/LICENSE.txt for license information.
|
|
10 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
11 //
|
|
12 //===----------------------------------------------------------------------===//
|
|
13
|
|
14 #include "tsan_annotations.h"
|
|
15
|
|
16 #include <stdio.h>
|
|
17
|
|
18 typedef unsigned long uptr;
|
|
19 typedef signed long sptr;
|
|
20
|
|
21 extern "C" __attribute__((weak)) void AnnotateHappensBefore(const char *f,
|
|
22 int l, uptr addr) {}
|
|
23 extern "C" __attribute__((weak)) void AnnotateHappensAfter(const char *f, int l,
|
|
24 uptr addr) {}
|
|
25 extern "C" __attribute__((weak)) void AnnotateCondVarSignal(const char *f,
|
|
26 int l, uptr cv) {}
|
|
27 extern "C" __attribute__((weak)) void AnnotateCondVarSignalAll(const char *f,
|
|
28 int l, uptr cv) {
|
|
29 }
|
|
30 extern "C" __attribute__((weak)) void AnnotateMutexIsNotPHB(const char *f,
|
|
31 int l, uptr mu) {}
|
|
32 extern "C" __attribute__((weak)) void AnnotateCondVarWait(const char *f, int l,
|
|
33 uptr cv, uptr lock) {}
|
|
34 extern "C" __attribute__((weak)) void AnnotateRWLockCreate(const char *f, int l,
|
|
35 uptr m) {}
|
|
36 extern "C" __attribute__((weak)) void
|
|
37 AnnotateRWLockCreateStatic(const char *f, int l, uptr m) {}
|
|
38 extern "C" __attribute__((weak)) void AnnotateRWLockDestroy(const char *f,
|
|
39 int l, uptr m) {}
|
|
40 extern "C" __attribute__((weak)) void
|
|
41 AnnotateRWLockAcquired(const char *f, int l, uptr m, uptr is_w) {}
|
|
42 extern "C" __attribute__((weak)) void
|
|
43 AnnotateRWLockReleased(const char *f, int l, uptr m, uptr is_w) {}
|
|
44 extern "C" __attribute__((weak)) void AnnotateTraceMemory(const char *f, int l,
|
|
45 uptr mem) {}
|
|
46 extern "C" __attribute__((weak)) void AnnotateFlushState(const char *f, int l) {
|
|
47 }
|
|
48 extern "C" __attribute__((weak)) void AnnotateNewMemory(const char *f, int l,
|
|
49 uptr mem, uptr size) {}
|
|
50 extern "C" __attribute__((weak)) void AnnotateNoOp(const char *f, int l,
|
|
51 uptr mem) {}
|
|
52 extern "C" __attribute__((weak)) void AnnotateFlushExpectedRaces(const char *f,
|
|
53 int l) {}
|
|
54 extern "C" __attribute__((weak)) void
|
|
55 AnnotateEnableRaceDetection(const char *f, int l, int enable) {}
|
|
56 extern "C" __attribute__((weak)) void
|
|
57 AnnotateMutexIsUsedAsCondVar(const char *f, int l, uptr mu) {}
|
|
58 extern "C" __attribute__((weak)) void AnnotatePCQGet(const char *f, int l,
|
|
59 uptr pcq) {}
|
|
60 extern "C" __attribute__((weak)) void AnnotatePCQPut(const char *f, int l,
|
|
61 uptr pcq) {}
|
|
62 extern "C" __attribute__((weak)) void AnnotatePCQDestroy(const char *f, int l,
|
|
63 uptr pcq) {}
|
|
64 extern "C" __attribute__((weak)) void AnnotatePCQCreate(const char *f, int l,
|
|
65 uptr pcq) {}
|
|
66 extern "C" __attribute__((weak)) void AnnotateExpectRace(const char *f, int l,
|
|
67 uptr mem, char *desc) {
|
|
68 }
|
|
69 extern "C" __attribute__((weak)) void
|
|
70 AnnotateBenignRaceSized(const char *f, int l, uptr mem, uptr size, char *desc) {
|
|
71 }
|
|
72 extern "C" __attribute__((weak)) void AnnotateBenignRace(const char *f, int l,
|
|
73 uptr mem, char *desc) {
|
|
74 }
|
|
75 extern "C" __attribute__((weak)) void AnnotateIgnoreReadsBegin(const char *f,
|
|
76 int l) {}
|
|
77 extern "C" __attribute__((weak)) void AnnotateIgnoreReadsEnd(const char *f,
|
|
78 int l) {}
|
|
79 extern "C" __attribute__((weak)) void AnnotateIgnoreWritesBegin(const char *f,
|
|
80 int l) {}
|
|
81 extern "C" __attribute__((weak)) void AnnotateIgnoreWritesEnd(const char *f,
|
|
82 int l) {}
|
|
83 extern "C" __attribute__((weak)) void AnnotateIgnoreSyncBegin(const char *f,
|
|
84 int l) {}
|
|
85 extern "C" __attribute__((weak)) void AnnotateIgnoreSyncEnd(const char *f,
|
|
86 int l) {}
|
|
87 extern "C" __attribute__((weak)) void
|
|
88 AnnotatePublishMemoryRange(const char *f, int l, uptr addr, uptr size) {}
|
|
89 extern "C" __attribute__((weak)) void
|
|
90 AnnotateUnpublishMemoryRange(const char *f, int l, uptr addr, uptr size) {}
|
|
91 extern "C" __attribute__((weak)) void AnnotateThreadName(const char *f, int l,
|
|
92 char *name) {}
|
|
93 extern "C" __attribute__((weak)) void
|
|
94 WTFAnnotateHappensBefore(const char *f, int l, uptr addr) {}
|
|
95 extern "C" __attribute__((weak)) void
|
|
96 WTFAnnotateHappensAfter(const char *f, int l, uptr addr) {}
|
|
97 extern "C" __attribute__((weak)) void
|
|
98 WTFAnnotateBenignRaceSized(const char *f, int l, uptr mem, uptr sz,
|
|
99 char *desc) {}
|
|
100 extern "C" __attribute__((weak)) int RunningOnValgrind() { return 0; }
|
|
101 extern "C" __attribute__((weak)) double ValgrindSlowdown(void) { return 0; }
|
|
102 extern "C" __attribute__((weak)) const char __attribute__((weak)) *
|
|
103 ThreadSanitizerQuery(const char *query) {
|
|
104 return 0;
|
|
105 }
|
|
106 extern "C" __attribute__((weak)) void
|
|
107 AnnotateMemoryIsInitialized(const char *f, int l, uptr mem, uptr sz) {}
|