Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:27

0001 //===- llvm/Support/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file declares the llvm::sys atomic operations.
0010 //
0011 // DO NOT USE IN NEW CODE!
0012 //
0013 // New code should always rely on the std::atomic facilities in C++11.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_SUPPORT_ATOMIC_H
0018 #define LLVM_SUPPORT_ATOMIC_H
0019 
0020 #include "llvm/Support/DataTypes.h"
0021 
0022 // Windows will at times define MemoryFence.
0023 #ifdef MemoryFence
0024 #undef MemoryFence
0025 #endif
0026 
0027 namespace llvm {
0028   namespace sys {
0029     void MemoryFence();
0030 
0031 #ifdef _MSC_VER
0032     typedef long cas_flag;
0033 #else
0034     typedef uint32_t cas_flag;
0035 #endif
0036     cas_flag CompareAndSwap(volatile cas_flag* ptr,
0037                             cas_flag new_value,
0038                             cas_flag old_value);
0039   }
0040 }
0041 
0042 #endif