[llvm] r293902 - Make llvm::call_once more convenient to reuse out of LLVM

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 08:06:33 PST 2017

Author: kamil
Date: Thu Feb  2 10:06:33 2017
New Revision: 293902

URL: http://llvm.org/viewvc/llvm-project?rev=293902&view=rev
Make llvm::call_once more convenient to reuse out of LLVM

Currently users need to set call `using namespace llvm;`, with this change it's no longer needed.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, emaste, joerg, clayborg, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: chandlerc

Differential Revision: https://reviews.llvm.org/D29296


Modified: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=293902&r1=293901&r2=293902&view=diff
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h Thu Feb  2 10:06:33 2017
@@ -71,7 +71,8 @@ namespace llvm {
   /// This macro is the only way you should define your once flag for LLVM's
   /// call_once.
-#define LLVM_DEFINE_ONCE_FLAG(flag) static once_flag flag = Uninitialized
+#define LLVM_DEFINE_ONCE_FLAG(flag) \
+  static ::llvm::once_flag flag = ::llvm::Uninitialized

More information about the llvm-commits mailing list