LLVM
22.0.0git
include
llvm
Support
Atomic.h
Go to the documentation of this file.
1
//===- llvm/Support/Atomic.h - Atomic Operations -----------------*- 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 declares the llvm::sys atomic operations.
10
//
11
// DO NOT USE IN NEW CODE!
12
//
13
// New code should always rely on the std::atomic facilities in C++11.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_SUPPORT_ATOMIC_H
18
#define LLVM_SUPPORT_ATOMIC_H
19
20
#include "
llvm/Support/Compiler.h
"
21
#include "
llvm/Support/DataTypes.h
"
22
23
// Windows will at times define MemoryFence.
24
#ifdef MemoryFence
25
#undef MemoryFence
26
#endif
27
28
namespace
llvm
{
29
namespace
sys {
30
LLVM_ABI
void
MemoryFence
();
31
32
#ifdef _MSC_VER
33
typedef
long
cas_flag
;
34
#else
35
typedef
uint32_t
cas_flag
;
36
#endif
37
LLVM_ABI
cas_flag
CompareAndSwap
(
volatile
cas_flag
*ptr,
cas_flag
new_value,
38
cas_flag
old_value);
39
}
40
}
41
42
#endif
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition:
Compiler.h:213
uint32_t
DataTypes.h
llvm::sys::cas_flag
uint32_t cas_flag
Definition:
Atomic.h:35
llvm::sys::MemoryFence
LLVM_ABI void MemoryFence()
Definition:
Atomic.cpp:30
llvm::sys::CompareAndSwap
LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag *ptr, cas_flag new_value, cas_flag old_value)
Definition:
Atomic.cpp:44
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
Generated on Sat Aug 30 2025 05:06:13 for LLVM by
1.9.6