LLVM 19.0.0git
ThreadSanitizer.h
Go to the documentation of this file.
1//===- Transforms/Instrumentation/ThreadSanitizer.h - TSan Pass -----------===//
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"
17
18namespace llvm {
19class Function;
20class Module;
21
22/// A function pass for tsan instrumentation.
23///
24/// Instruments functions to detect race conditions reads. This function pass
25/// inserts calls to runtime library functions. If the functions aren't declared
26/// yet, the pass inserts the declarations. Otherwise the existing globals are
27struct ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
29 static bool isRequired() { return true; }
30};
31
32/// A module pass for tsan instrumentation.
33///
34/// Create ctor and init functions.
36 : public PassInfoMixin<ModuleThreadSanitizerPass> {
38 static bool isRequired() { return true; }
39};
40
41} // namespace llvm
42#endif /* LLVM_TRANSFORMS_INSTRUMENTATION_THREADSANITIZER_H */
#define F(x, y, z)
Definition: MD5.cpp:55
Machine Check Debug Module
FunctionAnalysisManager FAM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:348
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A module pass for tsan instrumentation.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:91
A function pass for tsan instrumentation.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)