Jonas Hahnfeld | 50fed04 | 2016-11-07 15:58:36 +0000 | [diff] [blame] | 1 | /* |
| 2 | * tsan_annotations.c -- ThreadSanitizer annotations to support data |
| 3 | * race detection in OpenMP programs. |
| 4 | */ |
| 5 | |
| 6 | |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // The LLVM Compiler Infrastructure |
| 10 | // |
| 11 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 12 | // Source Licenses. See LICENSE.txt for details. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "tsan_annotations.h" |
| 17 | |
| 18 | #include <stdio.h> |
| 19 | |
| 20 | typedef unsigned long uptr; |
| 21 | typedef signed long sptr; |
| 22 | |
| 23 | extern "C" __attribute__((weak)) void AnnotateHappensBefore(const char *f, int l, uptr addr) {} |
| 24 | extern "C" __attribute__((weak)) void AnnotateHappensAfter(const char *f, int l, uptr addr) {} |
| 25 | extern "C" __attribute__((weak)) void AnnotateCondVarSignal(const char *f, int l, uptr cv) {} |
| 26 | extern "C" __attribute__((weak)) void AnnotateCondVarSignalAll(const char *f, int l, uptr cv) {} |
| 27 | extern "C" __attribute__((weak)) void AnnotateMutexIsNotPHB(const char *f, int l, uptr mu) {} |
| 28 | extern "C" __attribute__((weak)) void AnnotateCondVarWait(const char *f, int l, uptr cv, uptr lock) {} |
| 29 | extern "C" __attribute__((weak)) void AnnotateRWLockCreate(const char *f, int l, uptr m) {} |
| 30 | extern "C" __attribute__((weak)) void AnnotateRWLockCreateStatic(const char *f, int l, uptr m) {} |
| 31 | extern "C" __attribute__((weak)) void AnnotateRWLockDestroy(const char *f, int l, uptr m) {} |
| 32 | extern "C" __attribute__((weak)) void AnnotateRWLockAcquired(const char *f, int l, uptr m, uptr is_w) {} |
| 33 | extern "C" __attribute__((weak)) void AnnotateRWLockReleased(const char *f, int l, uptr m, uptr is_w) {} |
| 34 | extern "C" __attribute__((weak)) void AnnotateTraceMemory(const char *f, int l, uptr mem) {} |
| 35 | extern "C" __attribute__((weak)) void AnnotateFlushState(const char *f, int l) {} |
| 36 | extern "C" __attribute__((weak)) void AnnotateNewMemory(const char *f, int l, uptr mem, uptr size) {} |
| 37 | extern "C" __attribute__((weak)) void AnnotateNoOp(const char *f, int l, uptr mem) {} |
| 38 | extern "C" __attribute__((weak)) void AnnotateFlushExpectedRaces(const char *f, int l) {} |
| 39 | extern "C" __attribute__((weak)) void AnnotateEnableRaceDetection( const char *f, int l, int enable) {} |
| 40 | extern "C" __attribute__((weak)) void AnnotateMutexIsUsedAsCondVar( const char *f, int l, uptr mu) {} |
| 41 | extern "C" __attribute__((weak)) void AnnotatePCQGet( const char *f, int l, uptr pcq) {} |
| 42 | extern "C" __attribute__((weak)) void AnnotatePCQPut( const char *f, int l, uptr pcq) {} |
| 43 | extern "C" __attribute__((weak)) void AnnotatePCQDestroy( const char *f, int l, uptr pcq) {} |
| 44 | extern "C" __attribute__((weak)) void AnnotatePCQCreate( const char *f, int l, uptr pcq) {} |
| 45 | extern "C" __attribute__((weak)) void AnnotateExpectRace( const char *f, int l, uptr mem, char *desc) {} |
| 46 | extern "C" __attribute__((weak)) void AnnotateBenignRaceSized( const char *f, int l, uptr mem, uptr size, char *desc) {} |
| 47 | extern "C" __attribute__((weak)) void AnnotateBenignRace( const char *f, int l, uptr mem, char *desc) {} |
| 48 | extern "C" __attribute__((weak)) void AnnotateIgnoreReadsBegin(const char *f, int l) {} |
| 49 | extern "C" __attribute__((weak)) void AnnotateIgnoreReadsEnd(const char *f, int l) {} |
| 50 | extern "C" __attribute__((weak)) void AnnotateIgnoreWritesBegin(const char *f, int l) {} |
| 51 | extern "C" __attribute__((weak)) void AnnotateIgnoreWritesEnd(const char *f, int l) {} |
| 52 | extern "C" __attribute__((weak)) void AnnotateIgnoreSyncBegin(const char *f, int l) {} |
| 53 | extern "C" __attribute__((weak)) void AnnotateIgnoreSyncEnd(const char *f, int l) {} |
| 54 | extern "C" __attribute__((weak)) void AnnotatePublishMemoryRange( const char *f, int l, uptr addr, uptr size) {} |
| 55 | extern "C" __attribute__((weak)) void AnnotateUnpublishMemoryRange( const char *f, int l, uptr addr, uptr size) {} |
| 56 | extern "C" __attribute__((weak)) void AnnotateThreadName( const char *f, int l, char *name) {} |
| 57 | extern "C" __attribute__((weak)) void WTFAnnotateHappensBefore(const char *f, int l, uptr addr) {} |
| 58 | extern "C" __attribute__((weak)) void WTFAnnotateHappensAfter(const char *f, int l, uptr addr) {} |
| 59 | extern "C" __attribute__((weak)) void WTFAnnotateBenignRaceSized( const char *f, int l, uptr mem, uptr sz, char *desc) {} |
| 60 | extern "C" __attribute__((weak)) int RunningOnValgrind() {return 0;} |
| 61 | extern "C" __attribute__((weak)) double ValgrindSlowdown(void) {return 0;} |
| 62 | extern "C" __attribute__((weak)) const char __attribute__((weak))* ThreadSanitizerQuery(const char *query) {return 0;} |
| 63 | extern "C" __attribute__((weak)) void AnnotateMemoryIsInitialized(const char *f, int l, uptr mem, uptr sz) {} |