[Lldb-commits] [PATCH] D29288: Switch std::call_once to llvm::call_once

Kamil Rytarowski via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 30 10:07:02 PST 2017


krytarowski added a comment.

In https://reviews.llvm.org/D29288#660636, @clayborg wrote:

> Be very careful when using this, you can't change member variables that used to be std::once to be statics. We also don't need the llvm namespace to be included with "using namespace llvm;" in many of the files.


`using namespace llvm;` is currently required in order to get this functional:

    enum InitStatus { Uninitialized = 0, Wait = 1, Done = 2 };
    typedef volatile sys::cas_flag once_flag;
    /// 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

`sys::cas_flag` is a member of the `llvm` namespace.


Repository:
  rL LLVM

https://reviews.llvm.org/D29288





More information about the lldb-commits mailing list