[Lldb-commits] [lldb] r106535 - in /lldb/trunk: include/lldb/Core/UserID.h source/Core/UserID.cpp

Benjamin Kramer benny.kra at googlemail.com
Tue Jun 22 03:44:12 PDT 2010


Author: d0k
Date: Tue Jun 22 05:44:12 2010
New Revision: 106535

URL: http://llvm.org/viewvc/llvm-project?rev=106535&view=rev
Log:
Move trivial parts of UserID into the header.

Modified:
    lldb/trunk/include/lldb/Core/UserID.h
    lldb/trunk/source/Core/UserID.cpp

Modified: lldb/trunk/include/lldb/Core/UserID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UserID.h?rev=106535&r1=106534&r2=106535&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/UserID.h (original)
+++ lldb/trunk/include/lldb/Core/UserID.h Tue Jun 22 05:44:12 2010
@@ -35,7 +35,7 @@
     //------------------------------------------------------------------
     /// Construct with optional user ID.
     //------------------------------------------------------------------
-    UserID (lldb::user_id_t uid = LLDB_INVALID_UID);
+    UserID (lldb::user_id_t uid = LLDB_INVALID_UID) : m_uid(uid) {}
 
     //------------------------------------------------------------------
     /// Destructor.
@@ -51,7 +51,7 @@
     /// Clears the object contents back to a default invalid state.
     //------------------------------------------------------------------
     void
-    Clear ();
+    Clear () { m_uid = LLDB_INVALID_UID; }
 
     //------------------------------------------------------------------
     /// Get accessor for the user ID.
@@ -60,7 +60,7 @@
     ///     The user ID.
     //------------------------------------------------------------------
     lldb::user_id_t
-    GetID () const;
+    GetID () const { return m_uid; }
 
     //------------------------------------------------------------------
     /// Set accessor for the user ID.
@@ -69,7 +69,7 @@
     ///     The new user ID.
     //------------------------------------------------------------------
     void
-    SetID (lldb::user_id_t uid);
+    SetID (lldb::user_id_t uid) { m_uid = uid; }
 
     //------------------------------------------------------------------
     /// Unary predicate function object that can search for a matching
@@ -88,13 +88,13 @@
         //--------------------------------------------------------------
         /// Construct with the user ID to look for.
         //--------------------------------------------------------------
-        IDMatches (lldb::user_id_t uid);
+        IDMatches (lldb::user_id_t uid) : m_uid(uid) {}
 
         //--------------------------------------------------------------
         /// Unary predicate function object callback.
         //--------------------------------------------------------------
         bool
-        operator () (const UserID& rhs) const;
+        operator () (const UserID& rhs) const { return m_uid == rhs.GetID(); }
 
     private:
         //--------------------------------------------------------------
@@ -114,8 +114,16 @@
 //--------------------------------------------------------------
 /// Stream the UserID object to a Stream.
 //--------------------------------------------------------------
-bool operator== (const UserID& lhs, const UserID& rhs);
-bool operator!= (const UserID& lhs, const UserID& rhs);
+inline bool operator== (const UserID& lhs, const UserID& rhs)
+{
+  return lhs.GetID() == rhs.GetID();
+}
+
+inline bool operator!= (const UserID& lhs, const UserID& rhs)
+{
+  return lhs.GetID() != rhs.GetID();
+}
+
 Stream& operator << (Stream& strm, const UserID& uid);
 
 } // namespace lldb_private

Modified: lldb/trunk/source/Core/UserID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserID.cpp?rev=106535&r1=106534&r2=106535&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserID.cpp (original)
+++ lldb/trunk/source/Core/UserID.cpp Tue Jun 22 05:44:12 2010
@@ -13,61 +13,13 @@
 using namespace lldb;
 using namespace lldb_private;
 
-UserID::UserID (user_id_t uid) :
-    m_uid(uid)
-{
-}
-
 UserID::~UserID ()
 {
 }
 
-void
-UserID::Clear ()
-{
-    m_uid = LLDB_INVALID_UID;
-}
-
-
-user_id_t
-UserID::GetID () const
-{
-    return m_uid;
-}
-
-void
-UserID::SetID (user_id_t uid)
-{
-    m_uid = uid;
-}
-
-UserID::IDMatches::IDMatches (user_id_t uid) :
-    m_uid(uid)
-{
-}
-
-bool
-UserID::IDMatches::operator() (const UserID& rhs) const
-{
-    return m_uid == rhs.GetID();
-}
-
 Stream&
 lldb_private::operator << (Stream& strm, const UserID& uid)
 {
     strm.Printf("{0x%8.8x}", uid.GetID());
     return strm;
 }
-
-bool
-lldb_private::operator== (const UserID& lhs, const UserID& rhs)
-{
-    return lhs.GetID() == rhs.GetID();
-}
-
-bool
-lldb_private::operator!= (const UserID& lhs, const UserID& rhs)
-{
-    return lhs.GetID() != rhs.GetID();
-}
-





More information about the lldb-commits mailing list