[Lldb-commits] [lldb] r251648 - Fix Clang-tidy modernize-use-nullptr warnings in remaining files in include/lldb/Target; other minor fixes.

Eugene Zelenko via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 29 13:33:47 PDT 2015


Author: eugenezelenko
Date: Thu Oct 29 15:33:47 2015
New Revision: 251648

URL: http://llvm.org/viewvc/llvm-project?rev=251648&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr warnings in remaining files in include/lldb/Target; other minor fixes.

Modified:
    lldb/trunk/include/lldb/Target/ExecutionContext.h
    lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
    lldb/trunk/include/lldb/Target/Platform.h
    lldb/trunk/include/lldb/Target/QueueItem.h
    lldb/trunk/include/lldb/Target/StackFrame.h
    lldb/trunk/include/lldb/Target/StackFrameList.h
    lldb/trunk/include/lldb/Target/StackID.h
    lldb/trunk/include/lldb/Target/TargetList.h
    lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h
    lldb/trunk/include/lldb/Target/ThreadSpec.h

Modified: lldb/trunk/include/lldb/Target/ExecutionContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ExecutionContext.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ExecutionContext.h (original)
+++ lldb/trunk/include/lldb/Target/ExecutionContext.h Thu Oct 29 15:33:47 2015
@@ -6,6 +6,21 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ExecutionContext_h_
+#define liblldb_ExecutionContext_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-private.h"
+#include "lldb/Target/StackID.h"
+#include "lldb/Host/Mutex.h"
+
+namespace lldb_private {
+
+//===----------------------------------------------------------------------===//
 /// Execution context objects refer to objects in the execution of the
 /// program that is being debugged. The consist of one or more of the 
 /// following objects: target, process, thread, and frame. Many objects
@@ -30,17 +45,6 @@
 /// to a wide variety of functions that require execution contexts.
 //===----------------------------------------------------------------------===//
 
-
-
-#ifndef liblldb_ExecutionContext_h_
-#define liblldb_ExecutionContext_h_
-
-#include "lldb/lldb-private.h"
-#include "lldb/Target/StackID.h"
-#include "lldb/Host/Mutex.h"
-
-namespace lldb_private {
-
 //----------------------------------------------------------------------
 /// @class ExecutionContextRef ExecutionContext.h "lldb/Target/ExecutionContext.h"
 /// @brief A class that holds a weak reference to an execution context.
@@ -86,7 +90,7 @@ public:
     ExecutionContextRef (const ExecutionContextRef &rhs);
 
     //------------------------------------------------------------------
-    /// Construct using an ExecutionContext object that might be NULL.
+    /// Construct using an ExecutionContext object that might be nullptr.
     /// 
     /// If \a exe_ctx_ptr is valid, then make weak references to any
     /// valid objects in the ExecutionContext, otherwise no weak 
@@ -102,22 +106,6 @@ public:
     ExecutionContextRef (const ExecutionContext &exe_ctx);
 
     //------------------------------------------------------------------
-    /// Assignment operator
-    /// 
-    /// Copy all weak references in \a rhs.
-    //------------------------------------------------------------------
-    ExecutionContextRef &
-    operator =(const ExecutionContextRef &rhs);
-
-    //------------------------------------------------------------------
-    /// Assignment operator from a ExecutionContext
-    /// 
-    /// Make weak references to any strongly referenced objects in \a exe_ctx.
-    //------------------------------------------------------------------
-    ExecutionContextRef &
-    operator =(const ExecutionContext &exe_ctx);
-
-    //------------------------------------------------------------------
     /// Construct using the target and all the selected items inside of it
     /// (the process and its selected thread, and the thread's selected
     /// frame). If there is no selected thread, default to the first thread
@@ -154,10 +142,27 @@ public:
     ExecutionContextRef (ExecutionContextScope &exe_scope);
 
     ~ExecutionContextRef();
+
+    //------------------------------------------------------------------
+    /// Assignment operator
+    /// 
+    /// Copy all weak references in \a rhs.
+    //------------------------------------------------------------------
+    ExecutionContextRef &
+    operator =(const ExecutionContextRef &rhs);
+
+    //------------------------------------------------------------------
+    /// Assignment operator from a ExecutionContext
+    /// 
+    /// Make weak references to any strongly referenced objects in \a exe_ctx.
+    //------------------------------------------------------------------
+    ExecutionContextRef &
+    operator =(const ExecutionContext &exe_ctx);
+
     //------------------------------------------------------------------
     /// Clear the object's state.
     ///
-    /// Sets the process and thread to NULL, and the frame index to an
+    /// Sets the process and thread to nullptr, and the frame index to an
     /// invalid value.
     //------------------------------------------------------------------
     void
@@ -394,6 +399,7 @@ public:
     ExecutionContext (const lldb::ProcessSP &process_sp);
     ExecutionContext (const lldb::ThreadSP &thread_sp);
     ExecutionContext (const lldb::StackFrameSP &frame_sp);
+
     //------------------------------------------------------------------
     // Create execution contexts from weak pointers
     //------------------------------------------------------------------
@@ -413,16 +419,6 @@ public:
     //------------------------------------------------------------------
     ExecutionContext (ExecutionContextScope *exe_scope);
     ExecutionContext (ExecutionContextScope &exe_scope);
-    
-
-    ExecutionContext &
-    operator =(const ExecutionContext &rhs);
-
-    bool
-    operator ==(const ExecutionContext &rhs) const;
-    
-    bool
-    operator !=(const ExecutionContext &rhs) const;
 
     //------------------------------------------------------------------
     /// Construct with process, thread, and frame index.
@@ -438,16 +434,26 @@ public:
     /// @param[in] frame
     ///     The frame index for this execution context.
     //------------------------------------------------------------------
-    ExecutionContext (Process* process,
-                      Thread *thread = NULL,
-                      StackFrame * frame = NULL);
+    ExecutionContext(Process* process,
+                     Thread *thread = nullptr,
+                     StackFrame * frame = nullptr);
 
 
     ~ExecutionContext();
+
+    ExecutionContext &
+    operator =(const ExecutionContext &rhs);
+
+    bool
+    operator ==(const ExecutionContext &rhs) const;
+    
+    bool
+    operator !=(const ExecutionContext &rhs) const;
+
     //------------------------------------------------------------------
     /// Clear the object's state.
     ///
-    /// Sets the process and thread to NULL, and the frame index to an
+    /// Sets the process and thread to nullptr, and the frame index to an
     /// invalid value.
     //------------------------------------------------------------------
     void
@@ -468,10 +474,10 @@ public:
     //------------------------------------------------------------------
     /// Returns a pointer to the target object.
     ///
-    /// The returned pointer might be NULL. Calling HasTargetScope(), 
+    /// The returned pointer might be nullptr. Calling HasTargetScope(), 
     /// HasProcessScope(), HasThreadScope(), or HasFrameScope() 
     /// can help to pre-validate this pointer so that this accessor can
-    /// freely be used without having to check for NULL each time.
+    /// freely be used without having to check for nullptr each time.
     ///
     /// @see ExecutionContext::HasTargetScope() const
     /// @see ExecutionContext::HasProcessScope() const
@@ -484,10 +490,10 @@ public:
     //------------------------------------------------------------------
     /// Returns a pointer to the process object.
     ///
-    /// The returned pointer might be NULL. Calling HasProcessScope(), 
+    /// The returned pointer might be nullptr. Calling HasProcessScope(), 
     /// HasThreadScope(), or HasFrameScope()  can help to pre-validate 
     /// this pointer so that this accessor can freely be used without
-    /// having to check for NULL each time.
+    /// having to check for nullptr each time.
     ///
     /// @see ExecutionContext::HasProcessScope() const
     /// @see ExecutionContext::HasThreadScope() const
@@ -499,10 +505,10 @@ public:
     //------------------------------------------------------------------
     /// Returns a pointer to the thread object.
     ///
-    /// The returned pointer might be NULL. Calling HasThreadScope() or
+    /// The returned pointer might be nullptr. Calling HasThreadScope() or
     /// HasFrameScope() can help to pre-validate this pointer so that 
     /// this accessor can freely be used without having to check for 
-    /// NULL each time.
+    /// nullptr each time.
     ///
     /// @see ExecutionContext::HasThreadScope() const
     /// @see ExecutionContext::HasFrameScope() const
@@ -516,9 +522,9 @@ public:
     //------------------------------------------------------------------
     /// Returns a pointer to the frame object.
     ///
-    /// The returned pointer might be NULL. Calling HasFrameScope(),
+    /// The returned pointer might be nullptr. Calling HasFrameScope(),
     /// can help to pre-validate this pointer so that this accessor can
-    /// freely be used without having to check for NULL each time.
+    /// freely be used without having to check for nullptr each time.
     ///
     /// @see ExecutionContext::HasFrameScope() const
     //------------------------------------------------------------------
@@ -776,6 +782,7 @@ protected:
     lldb::ThreadSP m_thread_sp;     ///< The thread that owns the frame
     lldb::StackFrameSP m_frame_sp;  ///< The stack frame in thread.
 };
+
 } // namespace lldb_private
 
-#endif  // liblldb_ExecutionContext_h_
+#endif // liblldb_ExecutionContext_h_

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Thu Oct 29 15:33:47 2015
@@ -1,4 +1,4 @@
-//===-- ObjCLanguageRuntime.h ---------------------------------------------------*- C++ -*-===//
+//===-- ObjCLanguageRuntime.h -----------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -14,9 +14,12 @@
 // C++ Includes
 #include <functional>
 #include <map>
+#include <memory>
 #include <unordered_set>
 
 // Other libraries and framework includes
+#include "llvm/Support/Casting.h"
+
 // Project includes
 #include "lldb/lldb-private.h"
 #include "lldb/Core/PluginInterface.h"
@@ -26,8 +29,6 @@
 #include "lldb/Symbol/Type.h"
 #include "lldb/Target/LanguageRuntime.h"
 
-#include "llvm/Support/Casting.h"
-
 class CommandObjectObjC_ClassTable_Dump;
 
 namespace lldb_private {
@@ -56,7 +57,6 @@ public:
     class ClassDescriptor
     {
     public:
-        
         ClassDescriptor() :
             m_is_kvo (eLazyBoolCalculate),
             m_is_cf (eLazyBoolCalculate),
@@ -65,10 +65,8 @@ public:
         }
 
         virtual
-        ~ClassDescriptor ()
-        {
-        }
-        
+        ~ClassDescriptor() = default;
+
         virtual ConstString
         GetClassName () = 0;
         
@@ -109,12 +107,12 @@ public:
         
         virtual bool
         IsValid () = 0;
-        
+
         virtual bool
-        GetTaggedPointerInfo (uint64_t* info_bits = NULL,
-                              uint64_t* value_bits = NULL,
-                              uint64_t* payload = NULL) = 0;
-        
+        GetTaggedPointerInfo(uint64_t* info_bits = nullptr,
+                             uint64_t* value_bits = nullptr,
+                             uint64_t* payload = nullptr) = 0;
+
         virtual uint64_t
         GetInstanceSize () = 0;
         
@@ -187,13 +185,13 @@ public:
     class EncodingToType
     {
     public:
+        virtual ~EncodingToType();
+
         virtual CompilerType RealizeType (ClangASTContext& ast_ctx, const char* name, bool for_expression);
         virtual CompilerType RealizeType (const char* name, bool for_expression);
         
         virtual CompilerType RealizeType (clang::ASTContext& ast_ctx, const char* name, bool for_expression) = 0;
         
-        virtual ~EncodingToType();
-        
     protected:
         std::unique_ptr<ClangASTContext> m_scratch_ast_ctx_ap;
     };
@@ -203,7 +201,7 @@ public:
     public:
         ObjCExceptionPrecondition();
 
-        ~ObjCExceptionPrecondition() override {}
+        ~ObjCExceptionPrecondition() override = default;
 
         bool EvaluatePrecondition(StoppointCallbackContext &context) override;
         void DescribePrecondition(Stream &stream, lldb::DescriptionLevel level) override;
@@ -219,21 +217,24 @@ public:
     class TaggedPointerVendor
     {
     public:
+        virtual
+        ~TaggedPointerVendor() = default;
+
         virtual bool
         IsPossibleTaggedPointer (lldb::addr_t ptr) = 0;
         
         virtual ObjCLanguageRuntime::ClassDescriptorSP
         GetClassDescriptor (lldb::addr_t ptr) = 0;
-        
-        virtual
-        ~TaggedPointerVendor () { }
+
     protected:
-        TaggedPointerVendor () = default;
+        TaggedPointerVendor() = default;
 
     private:
         DISALLOW_COPY_AND_ASSIGN(TaggedPointerVendor);
     };
     
+    ~ObjCLanguageRuntime() override;
+
     virtual TaggedPointerVendor*
     GetTaggedPointerVendor ()
     {
@@ -260,8 +261,6 @@ public:
     ClassDescriptorSP
     GetNonKVOClassDescriptor (ObjCISA isa);
     
-    ~ObjCLanguageRuntime() override;
-    
     lldb::LanguageType
     GetLanguageType () const override
     {
@@ -338,7 +337,7 @@ public:
     virtual DeclVendor *
     GetDeclVendor()
     {
-        return NULL;
+        return nullptr;
     }
     
     // Finds the byte offset of the child_type ivar in parent_type.  If it can't find the
@@ -385,7 +384,7 @@ protected:
     // Classes that inherit from ObjCLanguageRuntime can see and modify these
     //------------------------------------------------------------------
     ObjCLanguageRuntime(Process *process);
-    
+
     virtual bool CalculateHasNewLiteralsAndIndexing()
     {
         return false;

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Thu Oct 29 15:33:47 2015
@@ -37,7 +37,6 @@
 namespace lldb_private {
 
 class ModuleCache;
-
     enum MmapFlags {
       eMmapFlagsPrivate = 1,
       eMmapFlagsAnon = 2
@@ -46,11 +45,11 @@ class ModuleCache;
     class PlatformProperties : public Properties
     {
     public:
+        PlatformProperties();
+
         static ConstString
         GetSettingName ();
 
-        PlatformProperties();
-
         bool
         GetUseModuleCache () const;
         bool
@@ -81,6 +80,19 @@ class ModuleCache;
         public PluginInterface
     {
     public:
+        //------------------------------------------------------------------
+        /// Default Constructor
+        //------------------------------------------------------------------
+        Platform (bool is_host_platform);
+
+        //------------------------------------------------------------------
+        /// Destructor.
+        ///
+        /// The destructor is virtual since this class is designed to be
+        /// inherited from by the plug-in instance.
+        //------------------------------------------------------------------
+        ~Platform() override;
+
         static void
         Initialize ();
 
@@ -131,19 +143,6 @@ class ModuleCache;
         GetConnectedRemotePlatformAtIndex (uint32_t idx);
 
         //------------------------------------------------------------------
-        /// Default Constructor
-        //------------------------------------------------------------------
-        Platform (bool is_host_platform);
-
-        //------------------------------------------------------------------
-        /// Destructor.
-        ///
-        /// The destructor is virtual since this class is designed to be
-        /// inherited from by the plug-in instance.
-        //------------------------------------------------------------------
-        ~Platform() override;
-
-        //------------------------------------------------------------------
         /// Find a platform plugin for a given process.
         ///
         /// Scans the installed Platform plug-ins and tries to find
@@ -155,7 +154,7 @@ class ModuleCache;
         ///
         /// @param[in] plugin_name
         ///     An optional name of a specific platform plug-in that
-        ///     should be used. If NULL, pick the best plug-in.
+        ///     should be used. If nullptr, pick the best plug-in.
         //------------------------------------------------------------------
 //        static lldb::PlatformSP
 //        FindPlugin (Process *process, const ConstString &plugin_name);
@@ -184,7 +183,6 @@ class ModuleCache;
                            lldb::ModuleSP &module_sp,
                            const FileSpecList *module_search_paths_ptr);
 
-        
         //------------------------------------------------------------------
         /// Find a symbol file given a symbol file module specification.
         ///
@@ -475,7 +473,7 @@ class ModuleCache;
         virtual lldb::ProcessSP
         DebugProcess (ProcessLaunchInfo &launch_info,
                       Debugger &debugger,
-                      Target *target,       // Can be NULL, if NULL create a new target, else use existing one
+                      Target *target,       // Can be nullptr, if nullptr create a new target, else use existing one
                       Error &error);
 
         //------------------------------------------------------------------
@@ -499,7 +497,7 @@ class ModuleCache;
         virtual lldb::ProcessSP
         Attach (ProcessAttachInfo &attach_info,
                 Debugger &debugger,
-                Target *target,       // Can be NULL, if NULL create a new target, else use existing one
+                Target *target,       // Can be nullptr, if nullptr create a new target, else use existing one
                 Error &error) = 0;
 
         //------------------------------------------------------------------
@@ -595,6 +593,7 @@ class ModuleCache;
         {
             return m_max_uid_name_len;
         }
+
         // Used for column widths
         size_t
         GetMaxGroupIDNameLength() const
@@ -831,15 +830,15 @@ class ModuleCache;
         virtual lldb_private::OptionGroupOptions *
         GetConnectionOptions (CommandInterpreter& interpreter)
         {
-            return NULL;
+            return nullptr;
         }
         
         virtual lldb_private::Error
-        RunShellCommand(const char *command,           // Shouldn't be NULL
+        RunShellCommand(const char *command,           // Shouldn't be nullptr
                         const FileSpec &working_dir,   // Pass empty FileSpec to use the current working directory
-                        int *status_ptr,               // Pass NULL if you don't want the process exit status
-                        int *signo_ptr,                // Pass NULL if you don't want the signal that caused the process to exit
-                        std::string *command_output,   // Pass NULL if you don't want the command output
+                        int *status_ptr,               // Pass nullptr if you don't want the process exit status
+                        int *signo_ptr,                // Pass nullptr if you don't want the signal that caused the process to exit
+                        std::string *command_output,   // Pass nullptr if you don't want the command output
                         uint32_t timeout_sec);         // Timeout in seconds to wait for shell program to finish
 
         virtual void
@@ -1032,16 +1031,12 @@ class ModuleCache;
         GetCachedUserName (uint32_t uid)
         {
             Mutex::Locker locker (m_mutex);
-            IDToNameMap::iterator pos = m_uid_map.find (uid);
-            if (pos != m_uid_map.end())
-            {
-                // return the empty string if our string is NULL
-                // so we can tell when things were in the negative
-                // cached (didn't find a valid user name, don't keep
-                // trying)
-                return pos->second.AsCString("");
-            }
-            return NULL;
+            // return the empty string if our string is NULL
+            // so we can tell when things were in the negative
+            // cached (didn't find a valid user name, don't keep
+            // trying)
+            const auto pos = m_uid_map.find(uid);
+            return ((pos != m_uid_map.end()) ? pos->second.AsCString("") : nullptr);
         }
 
         const char *
@@ -1062,7 +1057,6 @@ class ModuleCache;
             Mutex::Locker locker (m_mutex);
             m_uid_map[uid] = ConstString();
         }
-        
 
         void
         ClearCachedUserNames ()
@@ -1075,16 +1069,12 @@ class ModuleCache;
         GetCachedGroupName (uint32_t gid)
         {
             Mutex::Locker locker (m_mutex);
-            IDToNameMap::iterator pos = m_gid_map.find (gid);
-            if (pos != m_gid_map.end())
-            {
-                // return the empty string if our string is NULL
-                // so we can tell when things were in the negative
-                // cached (didn't find a valid group name, don't keep
-                // trying)
-                return pos->second.AsCString("");
-            }
-            return NULL;
+            // return the empty string if our string is NULL
+            // so we can tell when things were in the negative
+            // cached (didn't find a valid group name, don't keep
+            // trying)
+            const auto pos = m_gid_map.find(gid);
+            return ((pos != m_gid_map.end()) ? pos->second.AsCString("") : nullptr);
         }
 
         const char *
@@ -1159,7 +1149,6 @@ class ModuleCache;
         DISALLOW_COPY_AND_ASSIGN (Platform);
     };
 
-    
     class PlatformList
     {
     public:
@@ -1169,11 +1158,9 @@ class ModuleCache;
             m_selected_platform_sp()
         {
         }
-        
-        ~PlatformList()
-        {
-        }
-        
+
+        ~PlatformList() = default;
+
         void
         Append (const lldb::PlatformSP &platform_sp, bool set_selected)
         {
@@ -1317,7 +1304,6 @@ class ModuleCache;
         std::string m_ssh_opts;
 
     private:
-
         DISALLOW_COPY_AND_ASSIGN(OptionGroupPlatformSSH);
     };
     
@@ -1349,6 +1335,7 @@ class ModuleCache;
         // Instance variables to hold the values for command options.
         
         std::string m_cache_dir;
+
     private:
         DISALLOW_COPY_AND_ASSIGN(OptionGroupPlatformCaching);
     };

Modified: lldb/trunk/include/lldb/Target/QueueItem.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/QueueItem.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/QueueItem.h (original)
+++ lldb/trunk/include/lldb/Target/QueueItem.h Thu Oct 29 15:33:47 2015
@@ -10,8 +10,14 @@
 #ifndef liblldb_QueueItem_h_
 #define liblldb_QueueItem_h_
 
+// C Includes
+// C++ Includes
+#include <memory>
+#include <string>
 #include <vector>
 
+// Other libraries and framework includes
+// Project includes
 #include "lldb/lldb-private.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-forward.h"
@@ -19,7 +25,6 @@
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ConstString.h"
 
-
 namespace lldb_private {
 
 //------------------------------------------------------------------
@@ -32,12 +37,10 @@ namespace lldb_private {
 // execution of the item begins.
 //------------------------------------------------------------------
 
-
 class QueueItem :
     public std::enable_shared_from_this<QueueItem>
 {
 public:
-
     QueueItem (lldb::QueueSP queue_sp, lldb::ProcessSP process_sp, lldb::addr_t item_ref, lldb_private::Address address);
 
     ~QueueItem ();
@@ -98,7 +101,7 @@ public:
     bool
     IsValid ()
     {
-        return m_queue_wp.lock() != NULL;
+        return m_queue_wp.lock() != nullptr;
     }
 
     //------------------------------------------------------------------
@@ -200,7 +203,6 @@ protected:
     void
     FetchEntireItem ();
 
-
     lldb::QueueWP           m_queue_wp;
     lldb::ProcessWP         m_process_wp;
 
@@ -220,16 +222,10 @@ protected:
     std::string             m_queue_label;
     std::string             m_target_queue_label;
 
-
 private:
-    //------------------------------------------------------------------
-    // For QueueItem only
-    //------------------------------------------------------------------
-
     DISALLOW_COPY_AND_ASSIGN (QueueItem);
-
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_QueueItem_h_
+#endif // liblldb_QueueItem_h_

Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Thu Oct 29 15:33:47 2015
@@ -12,6 +12,8 @@
 
 // C Includes
 // C++ Includes
+#include <memory>
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/Error.h"
@@ -223,7 +225,7 @@ public:
     /// executing.
     ///
     /// @return
-    ///   A pointer to the current Block.  NULL is returned if this can
+    ///   A pointer to the current Block.  nullptr is returned if this can
     ///   not be provided.
     //------------------------------------------------------------------
     Block *
@@ -351,7 +353,7 @@ public:
     ///   Optional string that will be prepended to the frame output description.
     //------------------------------------------------------------------
     void
-    DumpUsingSettingsFormat (Stream *strm, const char *frame_marker = NULL);
+    DumpUsingSettingsFormat(Stream *strm, const char *frame_marker = nullptr);
 
     //------------------------------------------------------------------
     /// Print a description for this frame using a default format.
@@ -388,10 +390,10 @@ public:
     ///   Returns true if successful.
     //------------------------------------------------------------------
     bool
-    GetStatus (Stream &strm,
-               bool show_frame_info,
-               bool show_source,
-               const char *frame_marker = NULL);
+    GetStatus(Stream &strm,
+              bool show_frame_info,
+              bool show_source,
+              const char *frame_marker = nullptr);
 
     //------------------------------------------------------------------
     /// Query whether this frame is a concrete frame on the call stack,
@@ -530,6 +532,7 @@ private:
     ValueObjectList m_variable_list_value_objects;  // Value objects for each variable in m_variable_list_sp
     StreamString m_disassembly;
     Mutex m_mutex;
+
     DISALLOW_COPY_AND_ASSIGN (StackFrame);
 };
 

Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Thu Oct 29 15:33:47 2015
@@ -12,6 +12,7 @@
 
 // C Includes
 // C++ Includes
+#include <memory>
 #include <vector>
 
 // Other libraries and framework includes
@@ -84,15 +85,14 @@ public:
     GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
 
     size_t
-    GetStatus (Stream &strm,
-               uint32_t first_frame,
-               uint32_t num_frames,
-               bool show_frame_info,
-               uint32_t num_frames_with_source,
-               const char *frame_marker = NULL);
+    GetStatus(Stream &strm,
+              uint32_t first_frame,
+              uint32_t num_frames,
+              bool show_frame_info,
+              uint32_t num_frames_with_source,
+              const char *frame_marker = nullptr);
     
 protected:
-
     friend class Thread;
 
     bool
@@ -129,9 +129,6 @@ protected:
     void
     SetCurrentInlinedDepth (uint32_t new_depth);
     
-    //------------------------------------------------------------------
-    // Classes that inherit from StackFrameList can see and modify these
-    //------------------------------------------------------------------
     typedef std::vector<lldb::StackFrameSP> collection;
     typedef collection::iterator iterator;
     typedef collection::const_iterator const_iterator;
@@ -147,12 +144,9 @@ protected:
     bool m_show_inlined_frames;
 
 private:
-    //------------------------------------------------------------------
-    // For StackFrameList only
-    //------------------------------------------------------------------
     DISALLOW_COPY_AND_ASSIGN (StackFrameList);
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_StackFrameList_h_
+#endif // liblldb_StackFrameList_h_

Modified: lldb/trunk/include/lldb/Target/StackID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackID.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackID.h (original)
+++ lldb/trunk/include/lldb/Target/StackID.h Thu Oct 29 15:33:47 2015
@@ -28,7 +28,7 @@ public:
     StackID () :
         m_pc (LLDB_INVALID_ADDRESS),
         m_cfa (LLDB_INVALID_ADDRESS),
-        m_symbol_scope (NULL)
+        m_symbol_scope (nullptr)
     {
     }
 
@@ -47,9 +47,7 @@ public:
     {
     }
 
-    ~StackID()
-    {
-    }
+    ~StackID() = default;
 
     lldb::addr_t
     GetPC() const
@@ -80,7 +78,7 @@ public:
     {
         m_pc = LLDB_INVALID_ADDRESS;
         m_cfa = LLDB_INVALID_ADDRESS;
-        m_symbol_scope = NULL;
+        m_symbol_scope = nullptr;
     }
     
     bool
@@ -108,7 +106,6 @@ public:
     }
 
 protected:
-
     friend class StackFrame;
 
     void
@@ -123,18 +120,15 @@ protected:
         m_cfa = cfa;
     }
 
-    //------------------------------------------------------------------
-    // Classes that inherit from StackID can see and modify these
-    //------------------------------------------------------------------
     lldb::addr_t m_pc;                  // The pc value for the function/symbol for this frame. This will
-                                        // only get used if the symbol scope is NULL (the code where we are
+                                        // only get used if the symbol scope is nullptr (the code where we are
                                         // stopped is not represented by any function or symbol in any
                                         // shared library).
     lldb::addr_t m_cfa;                 // The call frame address (stack pointer) value
                                         // at the beginning of the function that uniquely
                                         // identifies this frame (along with m_symbol_scope below)
-    SymbolContextScope *m_symbol_scope; // If NULL, there is no block or symbol for this frame.
-                                        // If not NULL, this will either be the scope for the 
+    SymbolContextScope *m_symbol_scope; // If nullptr, there is no block or symbol for this frame.
+                                        // If not nullptr, this will either be the scope for the 
                                         // lexical block for the frame, or the scope 
                                         // for the symbol. Symbol context scopes are 
                                         // always be unique pointers since the are part
@@ -151,4 +145,4 @@ bool operator<  (const StackID& lhs, con
 
 } // namespace lldb_private
 
-#endif  // liblldb_StackID_h_
+#endif // liblldb_StackID_h_

Modified: lldb/trunk/include/lldb/Target/TargetList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/TargetList.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/TargetList.h (original)
+++ lldb/trunk/include/lldb/Target/TargetList.h Thu Oct 29 15:33:47 2015
@@ -12,6 +12,8 @@
 
 // C Includes
 // C++ Includes
+#include <vector>
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/Broadcaster.h"
@@ -37,7 +39,6 @@ private:
     TargetList(Debugger &debugger);
 
 public:
-
     //------------------------------------------------------------------
     /// Broadcaster event bits definitions.
     //------------------------------------------------------------------
@@ -72,12 +73,12 @@ public:
     ///
     /// @param[in] file_spec
     ///     The main executable file for a debug target. This value
-    ///     can be NULL and the file can be set later using:
+    ///     can be nullptr and the file can be set later using:
     ///     Target::SetExecutableModule (ModuleSP&)
     ///
     /// @param[in] triple_cstr
     ///     A target triple string to be used for the target. This can 
-    ///     be NULL if the triple is not known or when attaching to a
+    ///     be nullptr if the triple is not known or when attaching to a
     ///     process.
     ///
     /// @param[in] get_dependent_modules
@@ -86,7 +87,7 @@ public:
     ///
     /// @param[in] platform_options
     ///     A pointer to the platform options to use when creating this
-    ///     target. If this value is NULL, then the currently selected 
+    ///     target. If this value is nullptr, then the currently selected 
     ///     platform will be used.
     ///
     /// @param[out] target_sp
@@ -149,7 +150,7 @@ public:
     //------------------------------------------------------------------
     /// Find the target that contains has an executable whose path
     /// matches \a exe_file_spec, and whose architecture matches
-    /// \a arch_ptr if arch_ptr is not NULL.
+    /// \a arch_ptr if arch_ptr is not nullptr.
     ///
     /// @param[in] exe_file_spec
     ///     A file spec containing a basename, or a full path (directory
@@ -160,18 +161,18 @@ public:
     ///     directory, then both must match.
     ///
     /// @param[in] exe_arch_ptr
-    ///     If not NULL then the architecture also needs to match, else
+    ///     If not nullptr then the architecture also needs to match, else
     ///     the architectures will be compared.
     ///
     /// @return
     ///     A shared pointer to a target object. The returned shared
-    ///     pointer will contain NULL if no target objects have a
+    ///     pointer will contain nullptr if no target objects have a
     ///     executable whose full or partial path matches
     ///     with a matching process ID.
     //------------------------------------------------------------------
     lldb::TargetSP
-    FindTargetWithExecutableAndArchitecture (const FileSpec &exe_file_spec,
-                                             const ArchSpec *exe_arch_ptr = NULL) const;
+    FindTargetWithExecutableAndArchitecture(const FileSpec &exe_file_spec,
+                                            const ArchSpec *exe_arch_ptr = nullptr) const;
 
     //------------------------------------------------------------------
     /// Find the target that contains a process with process ID \a
@@ -182,7 +183,7 @@ public:
     ///
     /// @return
     ///     A shared pointer to a target object. The returned shared
-    ///     pointer will contain NULL if no target objects own a process
+    ///     pointer will contain nullptr if no target objects own a process
     ///     with a matching process ID.
     //------------------------------------------------------------------
     lldb::TargetSP
@@ -232,7 +233,6 @@ protected:
     uint32_t m_selected_target_idx;
 
 private:
-
     lldb::TargetSP
     GetDummyTarget (lldb_private::Debugger &debugger);
 

Modified: lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h Thu Oct 29 15:33:47 2015
@@ -74,9 +74,9 @@ public:
     //------------------------------------------------------------------
     ThreadPlanShouldStopHere (ThreadPlan *owner);
     
-    ThreadPlanShouldStopHere (ThreadPlan *owner,
-                              const ThreadPlanShouldStopHereCallbacks *callbacks,
-                              void *baton = NULL);
+    ThreadPlanShouldStopHere(ThreadPlan *owner,
+                             const ThreadPlanShouldStopHereCallbacks *callbacks,
+                             void *baton = nullptr);
     virtual
     ~ThreadPlanShouldStopHere();
     
@@ -139,23 +139,15 @@ protected:
     // Implement this, and call it in the plan's constructor to set the default flags.
     virtual void SetFlagsToDefault () = 0;
 
-    //------------------------------------------------------------------
-    // Classes that inherit from ThreadPlanShouldStopHere can see and modify these
-    //------------------------------------------------------------------
     ThreadPlanShouldStopHereCallbacks m_callbacks;
     void * m_baton;
     ThreadPlan *m_owner;
     lldb_private::Flags m_flags;
 
 private:
-    //------------------------------------------------------------------
-    // For ThreadPlanShouldStopHere only
-    //------------------------------------------------------------------
-
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanShouldStopHere);
-
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_ThreadPlanShouldStopHere_h_
+#endif // liblldb_ThreadPlanShouldStopHere_h_

Modified: lldb/trunk/include/lldb/Target/ThreadSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadSpec.h?rev=251648&r1=251647&r2=251648&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadSpec.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadSpec.h Thu Oct 29 15:33:47 2015
@@ -1,4 +1,4 @@
-//===-- ThreadSpec.h ------------------------------------------------*- C++ -*-===//
+//===-- ThreadSpec.h --------------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -10,9 +10,12 @@
 #ifndef liblldb_ThreadSpec_h_
 #define liblldb_ThreadSpec_h_
 
-#include <map>
+// C Includes
+// C++ Includes
 #include <string>
 
+// Other libraries and framework includes
+// Project includes
 #include "lldb/lldb-private.h"
 
 namespace lldb_private {
@@ -110,7 +113,7 @@ public:
     {
         if (m_name.empty())
             return true;
-        else if (name == NULL)
+        else if (name == nullptr)
             return false;
         else
             return m_name == name;
@@ -124,7 +127,7 @@ public:
     {
         if (m_queue_name.empty())
             return true;
-        else if (queue_name == NULL)
+        else if (queue_name == nullptr)
             return false;
         else
             return m_queue_name == queue_name;
@@ -142,7 +145,6 @@ public:
     void
     GetDescription (Stream *s, lldb::DescriptionLevel level) const;
 
-protected:
 private:
     uint32_t m_index;
     lldb::tid_t m_tid;
@@ -152,4 +154,4 @@ private:
 
 } // namespace lldb_private
 
-#endif  // liblldb_ThreadSpec_h_
+#endif // liblldb_ThreadSpec_h_




More information about the lldb-commits mailing list