LLVM 22.0.0git
ThreadSanitizer.h
Go to the documentation of this file.
1//===- ThreadSanitizer.h - ThreadSanitizer instrumentation ------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the thread sanitizer pass.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_THREADSANITIZER_H
14#define LLVM_TRANSFORMS_INSTRUMENTATION_THREADSANITIZER_H
15
16#include "llvm/IR/PassManager.h"
18
19namespace llvm {
20class Function;
21class Module;
22
23/// A function pass for tsan instrumentation.
24///
25/// Instruments functions to detect race conditions reads. This function pass
26/// inserts calls to runtime library functions. If the functions aren't declared
27/// yet, the pass inserts the declarations. Otherwise the existing globals are
28struct ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
30 static bool isRequired() { return true; }
31};
32
33/// A module pass for tsan instrumentation.
34///
35/// Create ctor and init functions.
37 : public PassInfoMixin<ModuleThreadSanitizerPass> {
39 static bool isRequired() { return true; }
40};
41
42} // namespace llvm
43#endif /* LLVM_TRANSFORMS_INSTRUMENTATION_THREADSANITIZER_H */
#define LLVM_ABI
Definition: Compiler.h:213
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
Machine Check Debug Module
FunctionAnalysisManager FAM
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A module pass for tsan instrumentation.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70
A function pass for tsan instrumentation.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)