[llvm] r239545 - Replace an instance of custom atomics with standard ones.
Benjamin Kramer
benny.kra at googlemail.com
Thu Jun 11 10:30:34 PDT 2015
Author: d0k
Date: Thu Jun 11 12:30:34 2015
New Revision: 239545
URL: http://llvm.org/viewvc/llvm-project?rev=239545&view=rev
Log:
Replace an instance of custom atomics with standard ones.
Eventually I want to get rid of them entirely, but Statistic.h is still blocked
on MSVC bugs. No functionality change.
Modified:
llvm/trunk/lib/IR/DiagnosticInfo.cpp
Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=239545&r1=239544&r2=239545&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Thu Jun 11 12:30:34 2015
@@ -22,9 +22,9 @@
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/Atomic.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Regex.h"
+#include <atomic>
#include <string>
using namespace llvm;
@@ -87,8 +87,8 @@ PassRemarksAnalysis(
}
int llvm::getNextAvailablePluginDiagnosticKind() {
- static sys::cas_flag PluginKindID = DK_FirstPluginKind;
- return (int)sys::AtomicIncrement(&PluginKindID);
+ static std::atomic<int> PluginKindID(DK_FirstPluginKind);
+ return ++PluginKindID;
}
DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm(const Instruction &I,
More information about the llvm-commits
mailing list