]> granicus.if.org Git - llvm/commitdiff
Make llvm::call_once more convenient to reuse out of LLVM
authorKamil Rytarowski <n54@gmx.com>
Thu, 2 Feb 2017 16:06:33 +0000 (16:06 +0000)
committerKamil Rytarowski <n54@gmx.com>
Thu, 2 Feb 2017 16:06:33 +0000 (16:06 +0000)
Summary:
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293902 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Threading.h

index 4bef7ec8dd3f240667d339be3e280781ea302d25..e0001e330390dce9069f0a8d5c05bc55fa94b708 100644 (file)
@@ -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
 
 #endif