llvm/compiler-rt/lib/tsan/rtl/tsan_external.cpp

//===-- tsan_external.cpp -------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
//===----------------------------------------------------------------------===//
#include "tsan_rtl.h"
#include "sanitizer_common/sanitizer_ptrauth.h"

#if !SANITIZER_GO
#  include "tsan_interceptors.h"
#endif

namespace __tsan {

#define CALLERPC

struct TagData {};

static TagData registered_tags[kExternalTagMax] =;
static atomic_uint32_t used_tags{};
static TagData *GetTagData(uptr tag) {}

const char *GetObjectTypeFromTag(uptr tag) {}

const char *GetReportHeaderFromTag(uptr tag) {}

uptr TagFromShadowStackFrame(uptr pc) {}

#if !SANITIZER_GO

// We need to track tags for individual memory accesses, but there is no space
// in the shadow cells for them.  Instead we push/pop them onto the thread
// traces and ignore the extra tag frames when printing reports.
static void PushTag(ThreadState *thr, uptr tag) {}
static void PopTag(ThreadState *thr) {}

static void ExternalAccess(void *addr, uptr caller_pc, uptr tsan_caller_pc,
                           void *tag, AccessType typ) {}

extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE
void *__tsan_external_register_tag(const char *object_type) {}

SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_register_header(void *tag, const char *header) {}

SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_assign_tag(void *addr, void *tag) {}

SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_read(void *addr, void *caller_pc, void *tag) {}

SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_write(void *addr, void *caller_pc, void *tag) {}
}  // extern "C"

#endif  // !SANITIZER_GO

}  // namespace __tsan