Initialize std::atomic directly.
authorJacques Pienaar <jpienaar@google.com>
Wed, 27 Mar 2019 19:36:57 +0000 (12:36 -0700)
committerjpienaar <jpienaar@google.com>
Sat, 30 Mar 2019 00:46:26 +0000 (17:46 -0700)
Avoids error in OSS build:
error: copying variable of type 'std::atomic<unsigned int>' invokes deleted constructor
PiperOrigin-RevId: 240618765

mlir/lib/Pass/Pass.cpp

index c6170ae..9cb46d4 100644 (file)
@@ -194,10 +194,10 @@ void ModuleToFunctionPassAdaptorParallel::runOnModule() {
       funcAMPairs.emplace_back(&func, mam.slice(&func));
 
   // An index for the current function/analysis manager pair.
-  std::atomic<unsigned> funcIt = 0;
+  std::atomic<unsigned> funcIt(0);
 
   // An atomic failure variable for the async executors.
-  std::atomic<bool> passFailed = false;
+  std::atomic<bool> passFailed(false);
   llvm::parallel::for_each(
       llvm::parallel::par, asyncExecutors.begin(),
       std::next(asyncExecutors.begin(),