forked from OSchip/llvm-project
Move Predicate.h from Host to Utility
Summary: This class was initially in Host because its implementation used to be very OS-specific. However, with C++11, it has become a very simple std::condition_variable wrapper, with no host-specific code. It is also a general purpose utility class, so it makes sense for it to live in a place where it can be used by everyone. This has no effect on the layering right now, but it enables me to later move the Listener+Broadcaster+Event combo to a lower layer, which is important, as these are used in a lot of places (notably for launching a process in Host code). Reviewers: jingham, zturner, teemperor Reviewed By: zturner Subscribers: xiaobai, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50384 llvm-svn: 341089
This commit is contained in:
parent
b7e14332ea
commit
7fae4932ad
|
@ -11,8 +11,8 @@
|
|||
#define liblldb_Event_h_
|
||||
|
||||
#include "lldb/Core/Broadcaster.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/ConstString.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/Utility/StructuredData.h"
|
||||
#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
|
||||
#include "lldb/lldb-forward.h" // for EventDataSP, ProcessSP, Struct...
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
#define liblldb_IOHandler_h_
|
||||
|
||||
#include "lldb/Core/ValueObjectList.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/ConstString.h"
|
||||
#include "lldb/Utility/Flags.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/Utility/Stream.h"
|
||||
#include "lldb/Utility/StringList.h"
|
||||
#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
#include <vector>
|
||||
|
||||
#include "lldb/Host/ConnectionFileDescriptor.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/FileSpec.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
|
||||
namespace lldb_private {
|
||||
namespace line_editor {
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
#include "lldb/lldb-private.h"
|
||||
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Host/SocketAddress.h"
|
||||
#include "lldb/Utility/IOObject.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/Utility/Status.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
// Other libraries and framework includes
|
||||
// Project includes
|
||||
#include "lldb/Host/Pipe.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/Connection.h"
|
||||
#include "lldb/Utility/IOObject.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
|
||||
namespace lldb_private {
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@ typedef enum {
|
|||
eBroadcastNever, ///< No broadcast will be sent when the value is modified.
|
||||
eBroadcastAlways, ///< Always send a broadcast when the value is modified.
|
||||
eBroadcastOnChange ///< Only broadcast if the value changes when the value is
|
||||
///modified.
|
||||
/// modified.
|
||||
} PredicateBroadcastType;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
/// @class Predicate Predicate.h "lldb/Host/Predicate.h"
|
||||
/// @class Predicate Predicate.h "lldb/Utility/Predicate.h"
|
||||
/// A C++ wrapper class for providing threaded access to a value of
|
||||
/// type T.
|
||||
///
|
||||
|
@ -220,8 +220,8 @@ protected:
|
|||
T m_value; ///< The templatized value T that we are protecting access to
|
||||
mutable std::mutex m_mutex; ///< The mutex to use when accessing the data
|
||||
std::condition_variable m_condition; ///< The pthread condition variable to
|
||||
///use for signaling that data available
|
||||
///or changed.
|
||||
/// use for signaling that data available
|
||||
/// or changed.
|
||||
|
||||
private:
|
||||
//------------------------------------------------------------------
|
|
@ -38,7 +38,6 @@ module lldb_Host {
|
|||
module PipeBase { header "Host/PipeBase.h" export * }
|
||||
module Pipe { header "Host/Pipe.h" export * }
|
||||
module PosixApi { header "Host/PosixApi.h" export * }
|
||||
module Predicate { header "Host/Predicate.h" export * }
|
||||
module ProcessLauncher { header "Host/ProcessLauncher.h" export * }
|
||||
module ProcessRunLock { header "Host/ProcessRunLock.h" export * }
|
||||
module PseudoTerminal { header "Host/PseudoTerminal.h" export * }
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "lldb/Core/Debugger.h"
|
||||
#include "lldb/Core/StreamFile.h"
|
||||
#include "lldb/Host/File.h" // for File
|
||||
#include "lldb/Host/Predicate.h" // for Predicate, ::eBroad...
|
||||
#include "lldb/Utility/Predicate.h" // for Predicate, ::eBroad...
|
||||
#include "lldb/Utility/Status.h" // for Status
|
||||
#include "lldb/Utility/StreamString.h" // for StreamString
|
||||
#include "lldb/Utility/StringList.h" // for StringList
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "lldb/Host/HostInfo.h"
|
||||
#include "lldb/Host/HostProcess.h"
|
||||
#include "lldb/Host/MonitoringProcessLauncher.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Host/ProcessLauncher.h"
|
||||
#include "lldb/Host/ThreadLauncher.h"
|
||||
#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
|
||||
|
@ -62,6 +61,7 @@
|
|||
#include "lldb/Utility/DataBufferLLVM.h"
|
||||
#include "lldb/Utility/FileSpec.h"
|
||||
#include "lldb/Utility/Log.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/Utility/Status.h"
|
||||
#include "lldb/lldb-private-forward.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "lldb/Core/Communication.h"
|
||||
#include "lldb/Core/Listener.h"
|
||||
#include "lldb/Core/StreamBuffer.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/lldb-private.h"
|
||||
|
||||
class CommunicationKDP : public lldb_private::Communication {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "IDebugDelegate.h"
|
||||
|
||||
#include "lldb/Core/ModuleSpec.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Host/ThreadLauncher.h"
|
||||
#include "lldb/Host/windows/HostProcessWindows.h"
|
||||
#include "lldb/Host/windows/HostThreadWindows.h"
|
||||
|
@ -21,6 +20,7 @@
|
|||
#include "lldb/Target/ProcessLaunchInfo.h"
|
||||
#include "lldb/Utility/FileSpec.h"
|
||||
#include "lldb/Utility/Log.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/Utility/Status.h"
|
||||
|
||||
#include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include "ForwardDecl.h"
|
||||
#include "lldb/Host/HostProcess.h"
|
||||
#include "lldb/Host/HostThread.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Host/windows/windows.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
|
||||
namespace lldb_private {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include "lldb/Core/Communication.h"
|
||||
#include "lldb/Core/Listener.h"
|
||||
#include "lldb/Host/HostThread.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/Args.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "lldb/lldb-public.h"
|
||||
|
||||
#include "lldb/Utility/StringExtractorGDBRemote.h"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "lldb/Core/Broadcaster.h"
|
||||
#include "lldb/Core/Event.h"
|
||||
#include "lldb/Core/Listener.h"
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ set (FILES
|
|||
HostInfoTest.cpp
|
||||
HostTest.cpp
|
||||
MainLoopTest.cpp
|
||||
PredicateTest.cpp
|
||||
SocketAddressTest.cpp
|
||||
SocketTest.cpp
|
||||
SymbolsTest.cpp
|
||||
|
|
|
@ -12,6 +12,7 @@ add_lldb_unittest(UtilityTests
|
|||
JSONTest.cpp
|
||||
LogTest.cpp
|
||||
NameMatchesTest.cpp
|
||||
PredicateTest.cpp
|
||||
RegisterValueTest.cpp
|
||||
ScalarTest.cpp
|
||||
StateTest.cpp
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lldb/Host/Predicate.h"
|
||||
#include "lldb/Utility/Predicate.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include <thread>
|
||||
|
Loading…
Reference in New Issue