diff options
Diffstat (limited to 'lldb')
162 files changed, 432 insertions, 465 deletions
diff --git a/lldb/include/lldb/API/SBAddress.h b/lldb/include/lldb/API/SBAddress.h index a89ab8d5635..c5e8cc685a4 100644 --- a/lldb/include/lldb/API/SBAddress.h +++ b/lldb/include/lldb/API/SBAddress.h @@ -141,7 +141,7 @@ protected: private: - STD_UNIQUE_PTR(lldb_private::Address) m_opaque_ap; + std::unique_ptr<lldb_private::Address> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBCommandReturnObject.h b/lldb/include/lldb/API/SBCommandReturnObject.h index 9071a44aaee..cf04a3eab3f 100644 --- a/lldb/include/lldb/API/SBCommandReturnObject.h +++ b/lldb/include/lldb/API/SBCommandReturnObject.h @@ -118,7 +118,7 @@ protected: SetLLDBObjectPtr (lldb_private::CommandReturnObject *ptr); private: - STD_UNIQUE_PTR(lldb_private::CommandReturnObject) m_opaque_ap; + std::unique_ptr<lldb_private::CommandReturnObject> m_opaque_ap; }; } // namespace lldb diff --git a/lldb/include/lldb/API/SBDeclaration.h b/lldb/include/lldb/API/SBDeclaration.h index 36a1cc0dca1..190026c0d2d 100644 --- a/lldb/include/lldb/API/SBDeclaration.h +++ b/lldb/include/lldb/API/SBDeclaration.h @@ -80,7 +80,7 @@ namespace lldb { void SetDeclaration (const lldb_private::Declaration &lldb_object_ref); - STD_UNIQUE_PTR(lldb_private::Declaration) m_opaque_ap; + std::unique_ptr<lldb_private::Declaration> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBError.h b/lldb/include/lldb/API/SBError.h index 6fd160ddb16..fbfb34d24bf 100644 --- a/lldb/include/lldb/API/SBError.h +++ b/lldb/include/lldb/API/SBError.h @@ -93,7 +93,7 @@ protected: SetError (const lldb_private::Error &lldb_error); private: - STD_UNIQUE_PTR(lldb_private::Error) m_opaque_ap; + std::unique_ptr<lldb_private::Error> m_opaque_ap; void CreateIfNeeded (); diff --git a/lldb/include/lldb/API/SBExpressionOptions.h b/lldb/include/lldb/API/SBExpressionOptions.h index b6a90c6e9f9..eed9ed528be 100644 --- a/lldb/include/lldb/API/SBExpressionOptions.h +++ b/lldb/include/lldb/API/SBExpressionOptions.h @@ -81,7 +81,7 @@ protected: private: // This auto_pointer is made in the constructor and is always valid. - mutable STD_UNIQUE_PTR(lldb_private::EvaluateExpressionOptions) m_opaque_ap; + mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap; }; } // namespace lldb diff --git a/lldb/include/lldb/API/SBFileSpec.h b/lldb/include/lldb/API/SBFileSpec.h index 1bcc93cfb10..cc657b7a1a9 100644 --- a/lldb/include/lldb/API/SBFileSpec.h +++ b/lldb/include/lldb/API/SBFileSpec.h @@ -84,7 +84,7 @@ private: const lldb_private::FileSpec & ref() const; - STD_UNIQUE_PTR(lldb_private::FileSpec) m_opaque_ap; + std::unique_ptr<lldb_private::FileSpec> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBFileSpecList.h b/lldb/include/lldb/API/SBFileSpecList.h index d7630736c16..734e7d4d35c 100644 --- a/lldb/include/lldb/API/SBFileSpecList.h +++ b/lldb/include/lldb/API/SBFileSpecList.h @@ -63,7 +63,7 @@ friend class SBTarget; const lldb_private::FileSpecList & ref() const; - STD_UNIQUE_PTR(lldb_private::FileSpecList) m_opaque_ap; + std::unique_ptr<lldb_private::FileSpecList> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBLineEntry.h b/lldb/include/lldb/API/SBLineEntry.h index 2b6a66b635a..2d099a29798 100644 --- a/lldb/include/lldb/API/SBLineEntry.h +++ b/lldb/include/lldb/API/SBLineEntry.h @@ -90,7 +90,7 @@ private: void SetLineEntry (const lldb_private::LineEntry &lldb_object_ref); - STD_UNIQUE_PTR(lldb_private::LineEntry) m_opaque_ap; + std::unique_ptr<lldb_private::LineEntry> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBSourceManager.h b/lldb/include/lldb/API/SBSourceManager.h index 3221b6abc3b..5b52c49ff3e 100644 --- a/lldb/include/lldb/API/SBSourceManager.h +++ b/lldb/include/lldb/API/SBSourceManager.h @@ -45,7 +45,7 @@ protected: private: - STD_UNIQUE_PTR(lldb_private::SourceManagerImpl) m_opaque_ap; + std::unique_ptr<lldb_private::SourceManagerImpl> m_opaque_ap; }; } // namespace lldb diff --git a/lldb/include/lldb/API/SBStream.h b/lldb/include/lldb/API/SBStream.h index 9c21ade1b0a..5d038be5082 100644 --- a/lldb/include/lldb/API/SBStream.h +++ b/lldb/include/lldb/API/SBStream.h @@ -100,7 +100,7 @@ protected: private: DISALLOW_COPY_AND_ASSIGN (SBStream); - STD_UNIQUE_PTR(lldb_private::Stream) m_opaque_ap; + std::unique_ptr<lldb_private::Stream> m_opaque_ap; bool m_is_file; }; diff --git a/lldb/include/lldb/API/SBStringList.h b/lldb/include/lldb/API/SBStringList.h index 4b8696a8827..9d0be6e8a74 100644 --- a/lldb/include/lldb/API/SBStringList.h +++ b/lldb/include/lldb/API/SBStringList.h @@ -62,7 +62,7 @@ protected: private: - STD_UNIQUE_PTR(lldb_private::StringList) m_opaque_ap; + std::unique_ptr<lldb_private::StringList> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBSymbolContext.h b/lldb/include/lldb/API/SBSymbolContext.h index 640d4aed237..fee2d19179d 100644 --- a/lldb/include/lldb/API/SBSymbolContext.h +++ b/lldb/include/lldb/API/SBSymbolContext.h @@ -85,7 +85,7 @@ protected: SetSymbolContext (const lldb_private::SymbolContext *sc_ptr); private: - STD_UNIQUE_PTR(lldb_private::SymbolContext) m_opaque_ap; + std::unique_ptr<lldb_private::SymbolContext> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBSymbolContextList.h b/lldb/include/lldb/API/SBSymbolContextList.h index f2241e0da0d..6cc78e472c6 100644 --- a/lldb/include/lldb/API/SBSymbolContextList.h +++ b/lldb/include/lldb/API/SBSymbolContextList.h @@ -60,7 +60,7 @@ protected: operator*() const; private: - STD_UNIQUE_PTR(lldb_private::SymbolContextList) m_opaque_ap; + std::unique_ptr<lldb_private::SymbolContextList> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBType.h b/lldb/include/lldb/API/SBType.h index a96dec22142..701ba7bc8a2 100644 --- a/lldb/include/lldb/API/SBType.h +++ b/lldb/include/lldb/API/SBType.h @@ -65,7 +65,7 @@ protected: const lldb_private::TypeMemberImpl & ref () const; - STD_UNIQUE_PTR(lldb_private::TypeMemberImpl) m_opaque_ap; + std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap; }; class SBType @@ -234,7 +234,7 @@ public: private: - STD_UNIQUE_PTR(lldb_private::TypeListImpl) m_opaque_ap; + std::unique_ptr<lldb_private::TypeListImpl> m_opaque_ap; }; diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 1f6f096ce53..623c562b68c 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -440,7 +440,7 @@ protected: SetSP (const lldb::ValueObjectSP &sp, lldb::DynamicValueType use_dynamic, bool use_synthetic); private: - typedef STD_SHARED_PTR(ValueImpl) ValueImplSP; + typedef std::shared_ptr<ValueImpl> ValueImplSP; ValueImplSP m_opaque_sp; void diff --git a/lldb/include/lldb/API/SBValueList.h b/lldb/include/lldb/API/SBValueList.h index 0b0b2ea5d2f..503c7999f71 100644 --- a/lldb/include/lldb/API/SBValueList.h +++ b/lldb/include/lldb/API/SBValueList.h @@ -86,7 +86,7 @@ private: ValueListImpl & ref (); - STD_UNIQUE_PTR(ValueListImpl) m_opaque_ap; + std::unique_ptr<ValueListImpl> m_opaque_ap; }; diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h index 3f8a39e53c7..bd11a1c91e2 100644 --- a/lldb/include/lldb/Breakpoint/Breakpoint.h +++ b/lldb/include/lldb/Breakpoint/Breakpoint.h @@ -74,7 +74,7 @@ namespace lldb_private { /// not by the breakpoint. //---------------------------------------------------------------------- class Breakpoint: - public STD_ENABLE_SHARED_FROM_THIS(Breakpoint), + public std::enable_shared_from_this<Breakpoint>, public Stoppoint { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocation.h b/lldb/include/lldb/Breakpoint/BreakpointLocation.h index 7aa5b391664..014a9a39d9a 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointLocation.h +++ b/lldb/include/lldb/Breakpoint/BreakpointLocation.h @@ -46,7 +46,7 @@ namespace lldb_private { //---------------------------------------------------------------------- class BreakpointLocation : - public STD_ENABLE_SHARED_FROM_THIS(BreakpointLocation), + public std::enable_shared_from_this<BreakpointLocation>, public StoppointLocation { public: @@ -379,7 +379,7 @@ private: bool m_being_created; Address m_address; ///< The address defining this location. Breakpoint &m_owner; ///< The breakpoint that produced this object. - STD_UNIQUE_PTR(BreakpointOptions) m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options. + std::unique_ptr<BreakpointOptions> m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options. lldb::BreakpointSiteSP m_bp_site_sp; ///< Our breakpoint site (it may be shared by more than one location.) void diff --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h b/lldb/include/lldb/Breakpoint/BreakpointOptions.h index ac862e63417..8d26b448e2e 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h +++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h @@ -348,8 +348,8 @@ private: bool m_enabled; bool m_one_shot; uint32_t m_ignore_count; // Number of times to ignore this breakpoint - STD_UNIQUE_PTR(ThreadSpec) m_thread_spec_ap; // Thread for which this breakpoint will take - STD_UNIQUE_PTR(ClangUserExpression) m_condition_ap; // The condition to test. + std::unique_ptr<ThreadSpec> m_thread_spec_ap; // Thread for which this breakpoint will take + std::unique_ptr<ClangUserExpression> m_condition_ap; // The condition to test. }; diff --git a/lldb/include/lldb/Breakpoint/BreakpointSite.h b/lldb/include/lldb/Breakpoint/BreakpointSite.h index cc9ea9493d7..271a23c2e45 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointSite.h +++ b/lldb/include/lldb/Breakpoint/BreakpointSite.h @@ -39,7 +39,7 @@ namespace lldb_private { //---------------------------------------------------------------------- class BreakpointSite : - public STD_ENABLE_SHARED_FROM_THIS(BreakpointSite), + public std::enable_shared_from_this<BreakpointSite>, public StoppointLocation { public: diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h index c9cc5b664f3..5dbed03d540 100644 --- a/lldb/include/lldb/Breakpoint/Watchpoint.h +++ b/lldb/include/lldb/Breakpoint/Watchpoint.h @@ -28,7 +28,7 @@ namespace lldb_private { class Watchpoint : - public STD_ENABLE_SHARED_FROM_THIS(Watchpoint), + public std::enable_shared_from_this<Watchpoint>, public StoppointLocation { public: @@ -234,7 +234,7 @@ private: // the callback machinery. bool m_being_created; - STD_UNIQUE_PTR(ClangUserExpression) m_condition_ap; // The condition to test. + std::unique_ptr<ClangUserExpression> m_condition_ap; // The condition to test. void SetID(lldb::watch_id_t id) { m_loc_id = id; } diff --git a/lldb/include/lldb/Breakpoint/WatchpointOptions.h b/lldb/include/lldb/Breakpoint/WatchpointOptions.h index 2e6fcd130d4..64c65f92b44 100644 --- a/lldb/include/lldb/Breakpoint/WatchpointOptions.h +++ b/lldb/include/lldb/Breakpoint/WatchpointOptions.h @@ -247,7 +247,7 @@ private: WatchpointHitCallback m_callback; // This is the callback function pointer lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback bool m_callback_is_synchronous; - STD_UNIQUE_PTR(ThreadSpec) m_thread_spec_ap; // Thread for which this watchpoint will take + std::unique_ptr<ThreadSpec> m_thread_spec_ap; // Thread for which this watchpoint will take }; } // namespace lldb_private diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index 823474b0cac..4f80430163c 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -47,7 +47,7 @@ namespace lldb_private { class Debugger : - public STD_ENABLE_SHARED_FROM_THIS(Debugger), + public std::enable_shared_from_this<Debugger>, public UserID, public Properties, public BroadcasterManager @@ -359,10 +359,10 @@ protected: TargetList m_target_list; PlatformList m_platform_list; Listener m_listener; - STD_UNIQUE_PTR(SourceManager) m_source_manager_ap; // This is a scratch source manager that we return if we have no targets. + std::unique_ptr<SourceManager> m_source_manager_ap; // This is a scratch source manager that we return if we have no targets. SourceManager::SourceFileCache m_source_file_cache; // All the source managers for targets created in this debugger used this shared // source file cache. - STD_UNIQUE_PTR(CommandInterpreter) m_command_interpreter_ap; + std::unique_ptr<CommandInterpreter> m_command_interpreter_ap; InputReaderStack m_input_reader_stack; std::string m_input_reader_data; diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h index 18c6cc689c2..9a027e6705c 100644 --- a/lldb/include/lldb/Core/Disassembler.h +++ b/lldb/include/lldb/Core/Disassembler.h @@ -234,7 +234,7 @@ protected: }; class Disassembler : - public STD_ENABLE_SHARED_FROM_THIS(Disassembler), + public std::enable_shared_from_this<Disassembler>, public PluginInterface { public: diff --git a/lldb/include/lldb/Core/Event.h b/lldb/include/lldb/Core/Event.h index 4f945deb2ee..1c3eec0359c 100644 --- a/lldb/include/lldb/Core/Event.h +++ b/lldb/include/lldb/Core/Event.h @@ -205,7 +205,7 @@ private: Broadcaster * m_broadcaster; // The broadcaster that sent this event uint32_t m_type; // The bit describing this event - STD_UNIQUE_PTR(EventData) m_data_ap; // User specific data for this event + std::unique_ptr<EventData> m_data_ap; // User specific data for this event DISALLOW_COPY_AND_ASSIGN (Event); diff --git a/lldb/include/lldb/Core/Log.h b/lldb/include/lldb/Core/Log.h index 77f342a279e..dafb5b5aa51 100644 --- a/lldb/include/lldb/Core/Log.h +++ b/lldb/include/lldb/Core/Log.h @@ -224,7 +224,7 @@ public: ListCategories (Stream *strm) = 0; protected: - STD_UNIQUE_PTR(Log) m_log_ap; + std::unique_ptr<Log> m_log_ap; private: DISALLOW_COPY_AND_ASSIGN (LogChannel); diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h index 34b9f6c42dd..8cfe36e6c57 100644 --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -41,7 +41,7 @@ namespace lldb_private { /// made. //---------------------------------------------------------------------- class Module : - public STD_ENABLE_SHARED_FROM_THIS(Module), + public std::enable_shared_from_this<Module>, public SymbolContextScope { public: @@ -941,7 +941,7 @@ protected: ConstString m_object_name; ///< The name an object within this module that is selected, or empty of the module is represented by \a m_file. uint64_t m_object_offset; lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile - STD_UNIQUE_PTR(SymbolVendor) m_symfile_ap; ///< A pointer to the symbol vendor for this module. + std::unique_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module. ClangASTContext m_ast; ///< The AST context for this module. PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are diff --git a/lldb/include/lldb/Core/Section.h b/lldb/include/lldb/Core/Section.h index cc03aac2b10..02d40e9b074 100644 --- a/lldb/include/lldb/Core/Section.h +++ b/lldb/include/lldb/Core/Section.h @@ -100,7 +100,7 @@ protected: class Section : - public STD_ENABLE_SHARED_FROM_THIS(Section), + public std::enable_shared_from_this<Section>, public ModuleChild, public UserID, public Flags diff --git a/lldb/include/lldb/Core/SourceManager.h b/lldb/include/lldb/Core/SourceManager.h index f680cb97887..b850df774ba 100644 --- a/lldb/include/lldb/Core/SourceManager.h +++ b/lldb/include/lldb/Core/SourceManager.h @@ -86,7 +86,7 @@ public: #endif // SWIG - typedef STD_SHARED_PTR(File) FileSP; + typedef std::shared_ptr<File> FileSP; #ifndef SWIG diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h index 67486a23f9b..75c57c12f77 100644 --- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -151,7 +151,7 @@ protected: // we need to hold on to the SyntheticChildren because someone might delete the type binding while we are alive lldb::SyntheticChildrenSP m_synth_sp; - STD_UNIQUE_PTR(SyntheticChildrenFrontEnd) m_synth_filter_ap; + std::unique_ptr<SyntheticChildrenFrontEnd> m_synth_filter_ap; typedef std::map<uint32_t, ValueObject*> ByIndexMap; typedef std::map<const char*, uint32_t> NameToIndexMap; diff --git a/lldb/include/lldb/DataFormatters/FormatNavigator.h b/lldb/include/lldb/DataFormatters/FormatNavigator.h index 64aa2dd4281..aa8018954e7 100644 --- a/lldb/include/lldb/DataFormatters/FormatNavigator.h +++ b/lldb/include/lldb/DataFormatters/FormatNavigator.h @@ -256,11 +256,7 @@ public: typedef typename MapType::key_type MapKeyType; typedef typename MapType::mapped_type MapValueType; typedef typename BackEndType::CallbackType CallbackType; -#ifdef _LIBCPP_VERSION typedef typename std::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer; -#else - typedef typename std::tr1::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer; -#endif friend class TypeCategoryImpl; diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h index 0ffd171cfa7..b76d84f4772 100644 --- a/lldb/include/lldb/DataFormatters/TypeCategory.h +++ b/lldb/include/lldb/DataFormatters/TypeCategory.h @@ -180,7 +180,7 @@ namespace lldb_private { const char** matching_category = NULL, FormatCategoryItems* matching_type = NULL); - typedef STD_SHARED_PTR(TypeCategoryImpl) SharedPointer; + typedef std::shared_ptr<TypeCategoryImpl> SharedPointer; private: SummaryNavigator::SharedPointer m_summary_nav; diff --git a/lldb/include/lldb/DataFormatters/TypeFormat.h b/lldb/include/lldb/DataFormatters/TypeFormat.h index 041d4abf1f7..77135c448ed 100644 --- a/lldb/include/lldb/DataFormatters/TypeFormat.h +++ b/lldb/include/lldb/DataFormatters/TypeFormat.h @@ -133,7 +133,7 @@ namespace lldb_private { TypeFormatImpl (lldb::Format f = lldb::eFormatInvalid, const Flags& flags = Flags()); - typedef STD_SHARED_PTR(TypeFormatImpl) SharedPointer; + typedef std::shared_ptr<TypeFormatImpl> SharedPointer; typedef bool(*ValueCallback)(void*, ConstString, const lldb::TypeFormatImplSP&); ~TypeFormatImpl () diff --git a/lldb/include/lldb/DataFormatters/TypeSummary.h b/lldb/include/lldb/DataFormatters/TypeSummary.h index 4779bec5edb..2183384b9d6 100644 --- a/lldb/include/lldb/DataFormatters/TypeSummary.h +++ b/lldb/include/lldb/DataFormatters/TypeSummary.h @@ -331,7 +331,7 @@ namespace lldb_private { return m_my_revision; } - typedef STD_SHARED_PTR(TypeSummaryImpl) SharedPointer; + typedef std::shared_ptr<TypeSummaryImpl> SharedPointer; typedef bool(*SummaryCallback)(void*, ConstString, const lldb::TypeSummaryImplSP&); typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::TypeSummaryImplSP&); @@ -461,7 +461,7 @@ namespace lldb_private { return TypeSummaryImpl::eTypeCallback; } - typedef STD_SHARED_PTR(CXXFunctionSummaryFormat) SharedPointer; + typedef std::shared_ptr<CXXFunctionSummaryFormat> SharedPointer; private: DISALLOW_COPY_AND_ASSIGN(CXXFunctionSummaryFormat); @@ -535,7 +535,7 @@ namespace lldb_private { return TypeSummaryImpl::eTypeScript; } - typedef STD_SHARED_PTR(ScriptSummaryFormat) SharedPointer; + typedef std::shared_ptr<ScriptSummaryFormat> SharedPointer; private: diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h b/lldb/include/lldb/DataFormatters/TypeSynthetic.h index ede4847ad1c..21939c30aa7 100644 --- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h +++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h @@ -68,8 +68,8 @@ namespace lldb_private { virtual bool MightHaveChildren () = 0; - typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer; - typedef STD_UNIQUE_PTR(SyntheticChildrenFrontEnd) AutoPointer; + typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer; + typedef std::unique_ptr<SyntheticChildrenFrontEnd> AutoPointer; private: DISALLOW_COPY_AND_ASSIGN(SyntheticChildrenFrontEnd); @@ -247,7 +247,7 @@ namespace lldb_private { virtual SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd (ValueObject &backend) = 0; - typedef STD_SHARED_PTR(SyntheticChildren) SharedPointer; + typedef std::shared_ptr<SyntheticChildren> SharedPointer; typedef bool(*SyntheticChildrenCallback)(void*, ConstString, const SyntheticChildren::SharedPointer&); uint32_t& @@ -415,7 +415,7 @@ namespace lldb_private { return UINT32_MAX; } - typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer; + typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer; private: DISALLOW_COPY_AND_ASSIGN(FrontEnd); @@ -573,7 +573,7 @@ namespace lldb_private { return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp, name.GetCString()); } - typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer; + typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer; private: DISALLOW_COPY_AND_ASSIGN(FrontEnd); diff --git a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h index f01f27ced9d..5b73d29d1a9 100644 --- a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h +++ b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h @@ -714,7 +714,7 @@ private: DISALLOW_COPY_AND_ASSIGN (ParserVars); }; - STD_UNIQUE_PTR(ParserVars) m_parser_vars; + std::unique_ptr<ParserVars> m_parser_vars; //---------------------------------------------------------------------- /// Activate parser-specific variables @@ -756,7 +756,7 @@ private: TypeFromUser m_object_pointer_type; ///< The type of the "this" variable, if one exists }; - STD_UNIQUE_PTR(StructVars) m_struct_vars; + std::unique_ptr<StructVars> m_struct_vars; //---------------------------------------------------------------------- /// Activate struct variables @@ -795,7 +795,7 @@ private: lldb::addr_t m_materialized_location; ///< The address at which the struct is placed. Falls inside the allocated area. }; - STD_UNIQUE_PTR(MaterialVars) m_material_vars; + std::unique_ptr<MaterialVars> m_material_vars; //---------------------------------------------------------------------- /// Activate materialization-specific variables diff --git a/lldb/include/lldb/Expression/ClangExpressionParser.h b/lldb/include/lldb/Expression/ClangExpressionParser.h index 7192d8e8de1..3247f2094ba 100644 --- a/lldb/include/lldb/Expression/ClangExpressionParser.h +++ b/lldb/include/lldb/Expression/ClangExpressionParser.h @@ -112,7 +112,7 @@ public: Error PrepareForExecution (lldb::addr_t &func_addr, lldb::addr_t &func_end, - STD_UNIQUE_PTR(IRExecutionUnit) &execution_unit_ap, + std::unique_ptr<IRExecutionUnit> &execution_unit_ap, ExecutionContext &exe_ctx, bool &can_interpret, lldb_private::ExecutionPolicy execution_policy); @@ -136,14 +136,14 @@ public: private: ClangExpression & m_expr; ///< The expression to be parsed - STD_UNIQUE_PTR(llvm::LLVMContext) m_llvm_context; ///< The LLVM context to generate IR into - STD_UNIQUE_PTR(clang::FileManager) m_file_manager; ///< The Clang file manager object used by the compiler - STD_UNIQUE_PTR(clang::CompilerInstance) m_compiler; ///< The Clang compiler used to parse expressions into IR - STD_UNIQUE_PTR(clang::Builtin::Context) m_builtin_context; ///< Context for Clang built-ins - STD_UNIQUE_PTR(clang::SelectorTable) m_selector_table; ///< Selector table for Objective-C methods - STD_UNIQUE_PTR(clang::ASTContext) m_ast_context; ///< The AST context used to hold types and names for the parser - STD_UNIQUE_PTR(clang::CodeGenerator) m_code_generator; ///< The Clang object that generates IR - STD_UNIQUE_PTR(IRExecutionUnit) m_execution_unit; ///< The container for the finished Module + std::unique_ptr<llvm::LLVMContext> m_llvm_context; ///< The LLVM context to generate IR into + std::unique_ptr<clang::FileManager> m_file_manager; ///< The Clang file manager object used by the compiler + std::unique_ptr<clang::CompilerInstance> m_compiler; ///< The Clang compiler used to parse expressions into IR + std::unique_ptr<clang::Builtin::Context> m_builtin_context; ///< Context for Clang built-ins + std::unique_ptr<clang::SelectorTable> m_selector_table; ///< Selector table for Objective-C methods + std::unique_ptr<clang::ASTContext> m_ast_context; ///< The AST context used to hold types and names for the parser + std::unique_ptr<clang::CodeGenerator> m_code_generator; ///< The Clang object that generates IR + std::unique_ptr<IRExecutionUnit> m_execution_unit; ///< The container for the finished Module }; } diff --git a/lldb/include/lldb/Expression/ClangExpressionVariable.h b/lldb/include/lldb/Expression/ClangExpressionVariable.h index 138e65ed396..4f0ba6798b6 100644 --- a/lldb/include/lldb/Expression/ClangExpressionVariable.h +++ b/lldb/include/lldb/Expression/ClangExpressionVariable.h @@ -248,7 +248,7 @@ public: void TransferAddress (bool force = false); - typedef STD_SHARED_PTR(ValueObjectConstResult) ValueObjectConstResultSP; + typedef std::shared_ptr<ValueObjectConstResult> ValueObjectConstResultSP; //---------------------------------------------------------------------- /// Members diff --git a/lldb/include/lldb/Expression/ClangFunction.h b/lldb/include/lldb/Expression/ClangFunction.h index 9404f0ddc5f..ca7619f27d4 100644 --- a/lldb/include/lldb/Expression/ClangFunction.h +++ b/lldb/include/lldb/Expression/ClangFunction.h @@ -619,8 +619,8 @@ private: // For ClangFunction only //------------------------------------------------------------------ - STD_UNIQUE_PTR(ClangExpressionParser) m_parser; ///< The parser responsible for compiling the function. - STD_UNIQUE_PTR(IRExecutionUnit) m_execution_unit_ap; + std::unique_ptr<ClangExpressionParser> m_parser; ///< The parser responsible for compiling the function. + std::unique_ptr<IRExecutionUnit> m_execution_unit_ap; Function *m_function_ptr; ///< The function we're going to call. May be NULL if we don't have debug info for the function. Address m_function_addr; ///< If we don't have the FunctionSP, we at least need the address & return type. diff --git a/lldb/include/lldb/Expression/ClangUserExpression.h b/lldb/include/lldb/Expression/ClangUserExpression.h index 51e00614e46..0caa9dcaf7f 100644 --- a/lldb/include/lldb/Expression/ClangUserExpression.h +++ b/lldb/include/lldb/Expression/ClangUserExpression.h @@ -46,7 +46,7 @@ namespace lldb_private class ClangUserExpression : public ClangExpression { public: - typedef STD_SHARED_PTR(ClangUserExpression) ClangUserExpressionSP; + typedef std::shared_ptr<ClangUserExpression> ClangUserExpressionSP; enum { kDefaultTimeout = 500000u }; //------------------------------------------------------------------ @@ -420,10 +420,10 @@ private: std::string m_transformed_text; ///< The text of the expression, as send to the parser ResultType m_desired_type; ///< The type to coerce the expression's result to. If eResultTypeAny, inferred from the expression. - STD_UNIQUE_PTR(ClangExpressionDeclMap) m_expr_decl_map; ///< The map to use when parsing the expression. - STD_UNIQUE_PTR(IRExecutionUnit) m_execution_unit_ap; ///< The execution unit the expression is stored in. - STD_UNIQUE_PTR(Materializer) m_materializer_ap; ///< The materializer to use when running the expression. - STD_UNIQUE_PTR(ASTResultSynthesizer) m_result_synthesizer; ///< The result synthesizer, if one is needed. + std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map; ///< The map to use when parsing the expression. + std::unique_ptr<IRExecutionUnit> m_execution_unit_ap; ///< The execution unit the expression is stored in. + std::unique_ptr<Materializer> m_materializer_ap; ///< The materializer to use when running the expression. + std::unique_ptr<ASTResultSynthesizer> m_result_synthesizer; ///< The result synthesizer, if one is needed. bool m_enforce_valid_object; ///< True if the expression parser should enforce the presence of a valid class pointer in order to generate the expression as a method. bool m_cplusplus; ///< True if the expression is compiled as a C++ member function (true if it was parsed when exe_ctx was in a C++ method). diff --git a/lldb/include/lldb/Expression/ClangUtilityFunction.h b/lldb/include/lldb/Expression/ClangUtilityFunction.h index b1ed4b6d0ea..6da8e5ec3a8 100644 --- a/lldb/include/lldb/Expression/ClangUtilityFunction.h +++ b/lldb/include/lldb/Expression/ClangUtilityFunction.h @@ -167,8 +167,8 @@ public: } private: - STD_UNIQUE_PTR(ClangExpressionDeclMap) m_expr_decl_map; ///< The map to use when parsing and materializing the expression. - STD_UNIQUE_PTR(IRExecutionUnit) m_execution_unit_ap; + std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map; ///< The map to use when parsing and materializing the expression. + std::unique_ptr<IRExecutionUnit> m_execution_unit_ap; std::string m_function_text; ///< The text of the function. Must be a well-formed translation unit. std::string m_function_name; ///< The name of the function. diff --git a/lldb/include/lldb/Expression/IRDynamicChecks.h b/lldb/include/lldb/Expression/IRDynamicChecks.h index 761d1c04b32..226f5c94e98 100644 --- a/lldb/include/lldb/Expression/IRDynamicChecks.h +++ b/lldb/include/lldb/Expression/IRDynamicChecks.h @@ -77,8 +77,8 @@ public: bool DoCheckersExplainStop (lldb::addr_t addr, Stream &message); - STD_UNIQUE_PTR(ClangUtilityFunction) m_valid_pointer_check; - STD_UNIQUE_PTR(ClangUtilityFunction) m_objc_object_check; + std::unique_ptr<ClangUtilityFunction> m_valid_pointer_check; + std::unique_ptr<ClangUtilityFunction> m_objc_object_check; }; //---------------------------------------------------------------------- diff --git a/lldb/include/lldb/Expression/IRExecutionUnit.h b/lldb/include/lldb/Expression/IRExecutionUnit.h index 37012e7f226..9bc55920474 100644 --- a/lldb/include/lldb/Expression/IRExecutionUnit.h +++ b/lldb/include/lldb/Expression/IRExecutionUnit.h @@ -66,8 +66,8 @@ public: //------------------------------------------------------------------ /// Constructor //------------------------------------------------------------------ - IRExecutionUnit (STD_UNIQUE_PTR(llvm::LLVMContext) &context_ap, - STD_UNIQUE_PTR(llvm::Module) &module_ap, + IRExecutionUnit (std::unique_ptr<llvm::LLVMContext> &context_ap, + std::unique_ptr<llvm::Module> &module_ap, ConstString &name, const lldb::TargetSP &target_sp, std::vector<std::string> &cpu_features); @@ -422,7 +422,7 @@ private: return m_default_mm_ap->getPointerToNamedFunction(Name, AbortOnFailure); } private: - STD_UNIQUE_PTR(JITMemoryManager) m_default_mm_ap; ///< The memory allocator to use in actually creating space. All calls are passed through to it. + std::unique_ptr<JITMemoryManager> m_default_mm_ap; ///< The memory allocator to use in actually creating space. All calls are passed through to it. IRExecutionUnit &m_parent; ///< The execution unit this is a proxy for. }; @@ -502,9 +502,9 @@ private: typedef std::vector<AllocationRecord> RecordVector; RecordVector m_records; - STD_UNIQUE_PTR(llvm::LLVMContext) m_context_ap; - STD_UNIQUE_PTR(llvm::ExecutionEngine) m_execution_engine_ap; - STD_UNIQUE_PTR(llvm::Module) m_module_ap; ///< Holder for the module until it's been handed off + std::unique_ptr<llvm::LLVMContext> m_context_ap; + std::unique_ptr<llvm::ExecutionEngine> m_execution_engine_ap; + std::unique_ptr<llvm::Module> m_module_ap; ///< Holder for the module until it's been handed off llvm::Module *m_module; ///< Owned by the execution engine std::vector<std::string> m_cpu_features; llvm::SmallVector<JittedFunction, 1> m_jitted_functions; ///< A vector of all functions that have been JITted into machine code diff --git a/lldb/include/lldb/Expression/IRForTarget.h b/lldb/include/lldb/Expression/IRForTarget.h index 50bb5e7c5bb..8134909a98a 100644 --- a/lldb/include/lldb/Expression/IRForTarget.h +++ b/lldb/include/lldb/Expression/IRForTarget.h @@ -654,7 +654,7 @@ private: lldb_private::ConstString m_result_name; ///< The name of the result variable ($0, $1, ...) lldb_private::TypeFromParser m_result_type; ///< The type of the result variable. llvm::Module *m_module; ///< The module being processed, or NULL if that has not been determined yet. - STD_UNIQUE_PTR(llvm::DataLayout) m_target_data; ///< The target data for the module being processed, or NULL if there is no module. + std::unique_ptr<llvm::DataLayout> m_target_data; ///< The target data for the module being processed, or NULL if there is no module. lldb_private::ClangExpressionDeclMap *m_decl_map; ///< The DeclMap containing the Decls StaticDataAllocator m_data_allocator; ///< The allocator to use for constant strings lldb_private::IRMemoryMap &m_memory_map; ///< The memory map to pass to the IR interpreter diff --git a/lldb/include/lldb/Expression/IRMemoryMap.h b/lldb/include/lldb/Expression/IRMemoryMap.h index 8d2df83d5e2..7a97b293801 100644 --- a/lldb/include/lldb/Expression/IRMemoryMap.h +++ b/lldb/include/lldb/Expression/IRMemoryMap.h @@ -83,7 +83,7 @@ private: size_t m_size; ///< The size of the requested allocation uint32_t m_permissions; ///< The access permissions on the memory in the process. In the host, the memory is always read/write. uint8_t m_alignment; ///< The alignment of the requested allocation - STD_UNIQUE_PTR(DataBufferHeap) m_data_ap; + std::unique_ptr<DataBufferHeap> m_data_ap; AllocationPolicy m_policy; Allocation () : diff --git a/lldb/include/lldb/Expression/Materializer.h b/lldb/include/lldb/Expression/Materializer.h index 2d96f99f972..cb61c885885 100644 --- a/lldb/include/lldb/Expression/Materializer.h +++ b/lldb/include/lldb/Expression/Materializer.h @@ -73,8 +73,8 @@ public: lldb::addr_t m_process_address; }; - typedef STD_SHARED_PTR(Dematerializer) DematerializerSP; - typedef STD_WEAK_PTR(Dematerializer) DematerializerWP; + typedef std::shared_ptr<Dematerializer> DematerializerSP; + typedef std::weak_ptr<Dematerializer> DematerializerWP; DematerializerSP Materialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb::addr_t process_address, Error &err); @@ -152,7 +152,7 @@ public: private: uint32_t AddStructMember (Entity &entity); - typedef STD_UNIQUE_PTR(Entity) EntityUP; + typedef std::unique_ptr<Entity> EntityUP; typedef std::vector<EntityUP> EntityVector; unsigned m_result_index; diff --git a/lldb/include/lldb/Host/Terminal.h b/lldb/include/lldb/Host/Terminal.h index d0208f57658..b334717c796 100644 --- a/lldb/include/lldb/Host/Terminal.h +++ b/lldb/include/lldb/Host/Terminal.h @@ -173,7 +173,7 @@ protected: //------------------------------------------------------------------ Terminal m_tty; ///< A terminal int m_tflags; ///< Cached tflags information. - STD_UNIQUE_PTR(struct termios) m_termios_ap; ///< Cached terminal state information. + std::unique_ptr<struct termios> m_termios_ap; ///< Cached terminal state information. lldb::pid_t m_process_group;///< Cached process group information. }; diff --git a/lldb/include/lldb/Interpreter/Args.h b/lldb/include/lldb/Interpreter/Args.h index e0e748cdd8e..d06c3e56aec 100644 --- a/lldb/include/lldb/Interpreter/Args.h +++ b/lldb/include/lldb/Interpreter/Args.h @@ -30,7 +30,7 @@ namespace lldb_private { typedef std::pair<int, std::string> OptionArgValue; typedef std::pair<std::string, OptionArgValue> OptionArgPair; typedef std::vector<OptionArgPair> OptionArgVector; -typedef STD_SHARED_PTR(OptionArgVector) OptionArgVectorSP; +typedef std::shared_ptr<OptionArgVector> OptionArgVectorSP; struct OptionArgElement { diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index ebcd60a19ee..15911b4d6ba 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -463,7 +463,7 @@ private: OptionArgMap m_alias_options; // Stores any options (with or without arguments) that go with any alias. std::vector<std::string> m_command_history; std::string m_repeat_command; // Stores the command that will be executed for an empty command string. - STD_UNIQUE_PTR(ScriptInterpreter) m_script_interpreter_ap; + std::unique_ptr<ScriptInterpreter> m_script_interpreter_ap; char m_comment_char; char m_repeat_char; bool m_batch_command_mode; diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h index 96d5b497bc7..abc43b92434 100644 --- a/lldb/include/lldb/Interpreter/OptionValueProperties.h +++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h @@ -21,7 +21,9 @@ namespace lldb_private { -class OptionValueProperties : public OptionValue, public STD_ENABLE_SHARED_FROM_THIS(OptionValueProperties) +class OptionValueProperties : + public OptionValue, + public std::enable_shared_from_this<OptionValueProperties> { public: diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h index b2e8570d74b..a31e311a349 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h @@ -425,7 +425,7 @@ public: return lldb::ScriptInterpreterObjectSP(new ScriptInterpreterObject(object)); } - virtual STD_UNIQUE_PTR(ScriptInterpreterLocker) + virtual std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock (); const char * diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h index c2073e53100..a478e286cfc 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -181,7 +181,7 @@ public: virtual lldb::ScriptInterpreterObjectSP MakeScriptObject (void* object); - virtual STD_UNIQUE_PTR(ScriptInterpreterLocker) + virtual std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock (); void diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 10d45a57294..305775658f4 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -1014,18 +1014,18 @@ protected: // Classes that inherit from ClangASTContext can see and modify these //------------------------------------------------------------------ std::string m_target_triple; - STD_UNIQUE_PTR(clang::ASTContext) m_ast_ap; - STD_UNIQUE_PTR(clang::LangOptions) m_language_options_ap; - STD_UNIQUE_PTR(clang::FileManager) m_file_manager_ap; - STD_UNIQUE_PTR(clang::FileSystemOptions) m_file_system_options_ap; - STD_UNIQUE_PTR(clang::SourceManager) m_source_manager_ap; - STD_UNIQUE_PTR(clang::DiagnosticsEngine) m_diagnostics_engine_ap; - STD_UNIQUE_PTR(clang::DiagnosticConsumer) m_diagnostic_consumer_ap; + std::unique_ptr<clang::ASTContext> m_ast_ap; + std::unique_ptr<clang::LangOptions> m_language_options_ap; + std::unique_ptr<clang::FileManager> m_file_manager_ap; + std::unique_ptr<clang::FileSystemOptions> m_file_system_options_ap; + std::unique_ptr<clang::SourceManager> m_source_manager_ap; + std::unique_ptr<clang::DiagnosticsEngine> m_diagnostics_engine_ap; + std::unique_ptr<clang::DiagnosticConsumer> m_diagnostic_consumer_ap; llvm::IntrusiveRefCntPtr<clang::TargetOptions> m_target_options_rp; - STD_UNIQUE_PTR(clang::TargetInfo) m_target_info_ap; - STD_UNIQUE_PTR(clang::IdentifierTable) m_identifier_table_ap; - STD_UNIQUE_PTR(clang::SelectorTable) m_selector_table_ap; - STD_UNIQUE_PTR(clang::Builtin::Context) m_builtins_ap; + std::unique_ptr<clang::TargetInfo> m_target_info_ap; + std::unique_ptr<clang::IdentifierTable> m_identifier_table_ap; + std::unique_ptr<clang::SelectorTable> m_selector_table_ap; + std::unique_ptr<clang::Builtin::Context> m_builtins_ap; CompleteTagDeclCallback m_callback_tag_decl; CompleteObjCInterfaceDeclCallback m_callback_objc_decl; void * m_callback_baton; diff --git a/lldb/include/lldb/Symbol/ClangASTImporter.h b/lldb/include/lldb/Symbol/ClangASTImporter.h index db27aac0325..bc23230fbd9 100644 --- a/lldb/include/lldb/Symbol/ClangASTImporter.h +++ b/lldb/include/lldb/Symbol/ClangASTImporter.h @@ -157,7 +157,7 @@ public: // typedef std::vector < std::pair<lldb::ModuleSP, ClangNamespaceDecl> > NamespaceMap; - typedef STD_SHARED_PTR(NamespaceMap) NamespaceMapSP; + typedef std::shared_ptr<NamespaceMap> NamespaceMapSP; void RegisterNamespaceMap (const clang::NamespaceDecl *decl, NamespaceMapSP &namespace_map); @@ -285,7 +285,7 @@ private: clang::ASTContext *m_source_ctx; }; - typedef STD_SHARED_PTR(Minion) MinionSP; + typedef std::shared_ptr<Minion> MinionSP; typedef std::map<clang::ASTContext *, MinionSP> MinionMap; typedef std::map<const clang::NamespaceDecl *, NamespaceMapSP> NamespaceMetaMap; @@ -308,7 +308,7 @@ private: MapCompleter *m_map_completer; }; - typedef STD_SHARED_PTR(ASTContextMetadata) ASTContextMetadataSP; + typedef std::shared_ptr<ASTContextMetadata> ASTContextMetadataSP; typedef std::map<const clang::ASTContext *, ASTContextMetadataSP> ContextMetadataMap; ContextMetadataMap m_metadata_map; diff --git a/lldb/include/lldb/Symbol/CompileUnit.h b/lldb/include/lldb/Symbol/CompileUnit.h index 8468187eaa1..5de93670c5a 100644 --- a/lldb/include/lldb/Symbol/CompileUnit.h +++ b/lldb/include/lldb/Symbol/CompileUnit.h @@ -32,7 +32,7 @@ namespace lldb_private { /// files), and a line table. //---------------------------------------------------------------------- class CompileUnit : - public STD_ENABLE_SHARED_FROM_THIS(CompileUnit), + public std::enable_shared_from_this<CompileUnit>, public ModuleChild, public FileSpec, public UserID, @@ -401,7 +401,7 @@ protected: std::vector<lldb::FunctionSP> m_functions; ///< The sparsely populated list of shared pointers to functions ///< that gets populated as functions get partially parsed. FileSpecList m_support_files; ///< Files associated with this compile unit's line table and declarations. - STD_UNIQUE_PTR(LineTable) m_line_table_ap; ///< Line table that will get parsed on demand. + std::unique_ptr<LineTable> m_line_table_ap; ///< Line table that will get parsed on demand. lldb::VariableListSP m_variables; ///< Global and static variable list that will get parsed on demand. private: diff --git a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h index d5d5e071169..13a14f8c404 100644 --- a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h +++ b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h @@ -98,7 +98,7 @@ private: inst_length (0), ptr_encoding (0), initial_row() {} }; - typedef STD_SHARED_PTR(CIE) CIESP; + typedef std::shared_ptr<CIE> CIESP; typedef std::map<off_t, CIESP> cie_map_t; diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h index fe8d4621ece..04fd1c644bc 100644 --- a/lldb/include/lldb/Symbol/ObjectFile.h +++ b/lldb/include/lldb/Symbol/ObjectFile.h @@ -50,7 +50,7 @@ namespace lldb_private { /// this abstract class. //---------------------------------------------------------------------- class ObjectFile: - public STD_ENABLE_SHARED_FROM_THIS(ObjectFile), + public std::enable_shared_from_this<ObjectFile>, public PluginInterface, public ModuleChild { @@ -621,8 +621,8 @@ protected: lldb_private::UnwindTable m_unwind_table; /// < Table of FuncUnwinders objects created for this ObjectFile's functions lldb::ProcessWP m_process_wp; const lldb::addr_t m_memory_addr; - STD_UNIQUE_PTR(lldb_private::SectionList) m_sections_ap; - STD_UNIQUE_PTR(lldb_private::Symtab) m_symtab_ap; + std::unique_ptr<lldb_private::SectionList> m_sections_ap; + std::unique_ptr<lldb_private::Symtab> m_symtab_ap; //------------------------------------------------------------------ /// Sets the architecture for a module. At present the architecture diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index e7fe9742ee0..90fdb7f7767 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -367,12 +367,12 @@ private: lldb::TargetSP m_target_sp; std::string m_module_spec; lldb::ModuleSP m_module_sp; - STD_UNIQUE_PTR(FileSpec) m_file_spec_ap; + std::unique_ptr<FileSpec> m_file_spec_ap; size_t m_start_line; size_t m_end_line; std::string m_function_spec; std::string m_class_name; - STD_UNIQUE_PTR(AddressRange) m_address_range_ap; + std::unique_ptr<AddressRange> m_address_range_ap; uint32_t m_type; // Or'ed bits from SpecificationType }; diff --git a/lldb/include/lldb/Symbol/SymbolVendor.h b/lldb/include/lldb/Symbol/SymbolVendor.h index f08012f84a4..9567c514ebd 100644 --- a/lldb/include/lldb/Symbol/SymbolVendor.h +++ b/lldb/include/lldb/Symbol/SymbolVendor.h @@ -191,7 +191,7 @@ protected: TypeList m_type_list; // Uniqued types for all parsers owned by this module CompileUnits m_compile_units; // The current compile units lldb::ObjectFileSP m_objfile_sp; // Keep a reference to the object file in case it isn't the same as the module object file (debug symbols in a separate file) - STD_UNIQUE_PTR(SymbolFile) m_sym_file_ap; // A single symbol file. Suclasses can add more of these if needed. + std::unique_ptr<SymbolFile> m_sym_file_ap; // A single symbol file. Suclasses can add more of these if needed. private: //------------------------------------------------------------------ diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index 5f4f4c96877..19cf4c84bc6 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -21,7 +21,7 @@ namespace lldb_private { class SymbolFileType : - public STD_ENABLE_SHARED_FROM_THIS(SymbolFileType), + public std::enable_shared_from_this<SymbolFileType>, public UserID { public: @@ -50,7 +50,7 @@ class SymbolFileType : }; class Type : - public STD_ENABLE_SHARED_FROM_THIS(Type), + public std::enable_shared_from_this<Type>, public UserID { public: diff --git a/lldb/include/lldb/Symbol/UnwindPlan.h b/lldb/include/lldb/Symbol/UnwindPlan.h index 7f277010c8a..6fc5ce04235 100644 --- a/lldb/include/lldb/Symbol/UnwindPlan.h +++ b/lldb/include/lldb/Symbol/UnwindPlan.h @@ -342,7 +342,7 @@ public: public: - typedef STD_SHARED_PTR(Row) RowSP; + typedef std::shared_ptr<Row> RowSP; UnwindPlan (lldb::RegisterKind reg_kind) : m_row_list (), diff --git a/lldb/include/lldb/Target/Memory.h b/lldb/include/lldb/Target/Memory.h index d7f66433e51..504370ef701 100644 --- a/lldb/include/lldb/Target/Memory.h +++ b/lldb/include/lldb/Target/Memory.h @@ -170,7 +170,7 @@ namespace lldb_private { DeallocateMemory (lldb::addr_t ptr); protected: - typedef STD_SHARED_PTR(AllocatedBlock) AllocatedBlockSP; + typedef std::shared_ptr<AllocatedBlock> AllocatedBlockSP; AllocatedBlockSP AllocatePage (uint32_t byte_size, diff --git a/lldb/include/lldb/Target/ObjCLanguageRuntime.h b/lldb/include/lldb/Target/ObjCLanguageRuntime.h index cb48b46dfe1..422e21775b4 100644 --- a/lldb/include/lldb/Target/ObjCLanguageRuntime.h +++ b/lldb/include/lldb/Target/ObjCLanguageRuntime.h @@ -138,7 +138,7 @@ public: typedef lldb::addr_t ObjCISA; class ClassDescriptor; - typedef STD_SHARED_PTR(ClassDescriptor) ClassDescriptorSP; + typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP; // the information that we want to support retrieving from an ObjC class // this needs to be pure virtual since there are at least 2 different implementations diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 41a03e54b77..833e1b1ec0c 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -93,7 +93,7 @@ public: SetStopOnSharedLibraryEvents (bool stop); }; -typedef STD_SHARED_PTR(ProcessProperties) ProcessPropertiesSP; +typedef std::shared_ptr<ProcessProperties> ProcessPropertiesSP; //---------------------------------------------------------------------- // ProcessInfo @@ -1343,7 +1343,7 @@ protected: /// @brief A plug-in interface definition class for debugging a process. //---------------------------------------------------------------------- class Process : - public STD_ENABLE_SHARED_FROM_THIS(Process), + public std::enable_shared_from_this<Process>, public ProcessProperties, public UserID, public Broadcaster, @@ -3588,9 +3588,9 @@ protected: std::vector<lldb::addr_t> m_image_tokens; Listener &m_listener; BreakpointSiteList m_breakpoint_site_list; ///< This is the list of breakpoint locations we intend to insert in the target. - STD_UNIQUE_PTR(DynamicLoader) m_dyld_ap; - STD_UNIQUE_PTR(DynamicCheckerFunctions) m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use. - STD_UNIQUE_PTR(OperatingSystem) m_os_ap; + std::unique_ptr<DynamicLoader> m_dyld_ap; + std::unique_ptr<DynamicCheckerFunctions> m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use. + std::unique_ptr<OperatingSystem> m_os_ap; UnixSignals m_unix_signals; /// This is the current signal set for this process. lldb::ABISP m_abi_sp; lldb::InputReaderSP m_process_input_reader; @@ -3604,7 +3604,7 @@ protected: AllocatedMemoryCache m_allocated_memory_cache; bool m_should_detach; /// Should we detach if the process object goes away with an explicit call to Kill or Detach? LanguageRuntimeCollection m_language_runtimes; - STD_UNIQUE_PTR(NextEventAction) m_next_event_action_ap; + std::unique_ptr<NextEventAction> m_next_event_action_ap; std::vector<PreResumeCallbackAndBaton> m_pre_resume_actions; ReadWriteLock m_public_run_lock; #if defined(__APPLE__) diff --git a/lldb/include/lldb/Target/RegisterContext.h b/lldb/include/lldb/Target/RegisterContext.h index 5f13fe125fa..a68629d6a7f 100644 --- a/lldb/include/lldb/Target/RegisterContext.h +++ b/lldb/include/lldb/Target/RegisterContext.h @@ -20,7 +20,7 @@ namespace lldb_private { class RegisterContext : - public STD_ENABLE_SHARED_FROM_THIS(RegisterContext), + public std::enable_shared_from_this<RegisterContext>, public ExecutionContextScope { public: diff --git a/lldb/include/lldb/Target/StackFrame.h b/lldb/include/lldb/Target/StackFrame.h index 96811c117ed..877bd8ce661 100644 --- a/lldb/include/lldb/Target/StackFrame.h +++ b/lldb/include/lldb/Target/StackFrame.h @@ -27,7 +27,7 @@ namespace lldb_private { class StackFrame : - public STD_ENABLE_SHARED_FROM_THIS(StackFrame), + public std::enable_shared_from_this<StackFrame>, public ExecutionContextScope { public: diff --git a/lldb/include/lldb/Target/StackFrameList.h b/lldb/include/lldb/Target/StackFrameList.h index 03c93087501..b2689d0391e 100644 --- a/lldb/include/lldb/Target/StackFrameList.h +++ b/lldb/include/lldb/Target/StackFrameList.h @@ -98,7 +98,7 @@ protected: SetFrameAtIndex (uint32_t idx, lldb::StackFrameSP &frame_sp); static void - Merge (STD_UNIQUE_PTR(StackFrameList)& curr_ap, + Merge (std::unique_ptr<StackFrameList>& curr_ap, lldb::StackFrameListSP& prev_sp); void diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index d50d5fac747..c73d7afda41 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -149,7 +149,7 @@ public: }; -typedef STD_SHARED_PTR(TargetProperties) TargetPropertiesSP; +typedef std::shared_ptr<TargetProperties> TargetPropertiesSP; class EvaluateExpressionOptions { @@ -285,7 +285,7 @@ private: // Target //---------------------------------------------------------------------- class Target : - public STD_ENABLE_SHARED_FROM_THIS(Target), + public std::enable_shared_from_this<Target>, public TargetProperties, public Broadcaster, public ExecutionContextScope, @@ -1023,7 +1023,7 @@ public: lldb::TargetSP m_target_sp; StringList m_commands; lldb::SymbolContextSpecifierSP m_specifier_sp; - STD_UNIQUE_PTR(ThreadSpec) m_thread_spec_ap; + std::unique_ptr<ThreadSpec> m_thread_spec_ap; bool m_active; // Use AddStopHook to make a new empty stop hook. The GetCommandPointer and fill it with commands, @@ -1031,7 +1031,7 @@ public: StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid); friend class Target; }; - typedef STD_SHARED_PTR(StopHook) StopHookSP; + typedef std::shared_ptr<StopHook> StopHookSP; // Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook. // Returns the id of the new hook. @@ -1159,12 +1159,12 @@ protected: bool m_valid; lldb::SearchFilterSP m_search_filter_sp; PathMappingList m_image_search_paths; - STD_UNIQUE_PTR(ClangASTContext) m_scratch_ast_context_ap; - STD_UNIQUE_PTR(ClangASTSource) m_scratch_ast_source_ap; - STD_UNIQUE_PTR(ClangASTImporter) m_ast_importer_ap; + std::unique_ptr<ClangASTContext> m_scratch_ast_context_ap; + std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap; + std::unique_ptr<ClangASTImporter> m_ast_importer_ap; ClangPersistentVariables m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser. - STD_UNIQUE_PTR(SourceManager) m_source_manager_ap; + std::unique_ptr<SourceManager> m_source_manager_ap; typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection; StopHookCollection m_stop_hooks; diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h index ebd4958158d..e642d19de66 100644 --- a/lldb/include/lldb/Target/Thread.h +++ b/lldb/include/lldb/Target/Thread.h @@ -47,10 +47,10 @@ public: GetTraceEnabledState() const; }; -typedef STD_SHARED_PTR(ThreadProperties) ThreadPropertiesSP; +typedef std::shared_ptr<ThreadProperties> ThreadPropertiesSP; class Thread : - public STD_ENABLE_SHARED_FROM_THIS(Thread), + public std::enable_shared_from_this<Thread>, public ThreadProperties, public UserID, public ExecutionContextScope, @@ -966,7 +966,7 @@ protected: lldb::StateType m_resume_state; ///< This state is used to force a thread to be suspended from outside the ThreadPlan logic. lldb::StateType m_temporary_resume_state; ///< This state records what the thread was told to do by the thread plan logic for the current resume. /// It gets set in Thread::WillResume. - STD_UNIQUE_PTR(lldb_private::Unwind) m_unwinder_ap; + std::unique_ptr<lldb_private::Unwind> m_unwinder_ap; bool m_destroy_called; // This is used internally to make sure derived Thread classes call DestroyThread. uint32_t m_thread_stop_reason_stop_id; // This is the stop id for which the StopInfo is valid. Can use this so you know that // the thread's m_actual_stop_info_sp is current and you don't have to fetch it again diff --git a/lldb/include/lldb/Target/ThreadPlanStepInRange.h b/lldb/include/lldb/Target/ThreadPlanStepInRange.h index 97a59bdf602..1a60e4e094f 100644 --- a/lldb/include/lldb/Target/ThreadPlanStepInRange.h +++ b/lldb/include/lldb/Target/ThreadPlanStepInRange.h @@ -93,7 +93,7 @@ private: // from step in. static uint32_t s_default_flag_values; - STD_UNIQUE_PTR(RegularExpression) m_avoid_regexp_ap; + std::unique_ptr<RegularExpression> m_avoid_regexp_ap; bool m_step_past_prologue; // FIXME: For now hard-coded to true, we could put a switch in for this if there's // demand for that. bool m_virtual_step; // true if we've just done a "virtual step", i.e. just moved the inline stack depth. diff --git a/lldb/include/lldb/Utility/PriorityPointerPair.h b/lldb/include/lldb/Utility/PriorityPointerPair.h index 974047ad81a..49f0765d0f9 100644 --- a/lldb/include/lldb/Utility/PriorityPointerPair.h +++ b/lldb/include/lldb/Utility/PriorityPointerPair.h @@ -30,7 +30,7 @@ public: typedef T& reference_type; typedef T* pointer_type; - typedef typename STD_SHARED_PTR(T) T_SP; + typedef typename std::shared_ptr<T> T_SP; PriorityPointerPair() : m_high(), diff --git a/lldb/include/lldb/Utility/SharingPtr.h b/lldb/include/lldb/Utility/SharingPtr.h index e5b2bceebbd..814b54b5cfe 100644 --- a/lldb/include/lldb/Utility/SharingPtr.h +++ b/lldb/include/lldb/Utility/SharingPtr.h @@ -198,7 +198,7 @@ template<class Y> SharingPtr<T>::SharingPtr(Y* p) : ptr_(p), cntrl_(0) { - std::auto_ptr<Y> hold(p); + std::unique_ptr<Y> hold(p); typedef imp::shared_ptr_pointer<Y*> _CntrlBlk; cntrl_ = new _CntrlBlk(p); hold.release(); diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index 4701c697f6a..60575939379 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -12,24 +12,6 @@ #if defined(__cplusplus) -#include <ciso646> // detect C++ lib - -#ifdef _LIBCPP_VERSION -#include <memory> -#define STD_SHARED_PTR(T) std::shared_ptr<T> -#define STD_WEAK_PTR(T) std::weak_ptr<T> -#define STD_UNIQUE_PTR(T) std::unique_ptr<T> -#define STD_ENABLE_SHARED_FROM_THIS(T) std::enable_shared_from_this<T> -#define STD_STATIC_POINTER_CAST(T,V) std::static_pointer_cast<T>(V) -#else -#include <tr1/memory> -#define STD_SHARED_PTR(T) std::tr1::shared_ptr<T> -#define STD_WEAK_PTR(T) std::tr1::weak_ptr<T> -#define STD_UNIQUE_PTR(T) std::auto_ptr<T> -#define STD_ENABLE_SHARED_FROM_THIS(T) std::tr1::enable_shared_from_this<T> -#define STD_STATIC_POINTER_CAST(T,V) std::tr1::static_pointer_cast<T>(V) -#endif - #include "lldb/Utility/SharingPtr.h" //---------------------------------------------------------------------- @@ -277,116 +259,116 @@ struct LineEntry; //---------------------------------------------------------------------- namespace lldb { - typedef STD_SHARED_PTR(lldb_private::ABI) ABISP; - typedef STD_SHARED_PTR(lldb_private::Baton) BatonSP; - typedef STD_SHARED_PTR(lldb_private::Block) BlockSP; - typedef STD_SHARED_PTR(lldb_private::Breakpoint) BreakpointSP; - typedef STD_WEAK_PTR( lldb_private::Breakpoint) BreakpointWP; - typedef STD_SHARED_PTR(lldb_private::BreakpointSite) BreakpointSiteSP; - typedef STD_WEAK_PTR( lldb_private::BreakpointSite) BreakpointSiteWP; - typedef STD_SHARED_PTR(lldb_private::BreakpointLocation) BreakpointLocationSP; - typedef STD_WEAK_PTR( lldb_private::BreakpointLocation) BreakpointLocationWP; - typedef STD_SHARED_PTR(lldb_private::BreakpointResolver) BreakpointResolverSP; - typedef STD_SHARED_PTR(lldb_private::Broadcaster) BroadcasterSP; - typedef STD_SHARED_PTR(lldb_private::ClangExpressionVariable) ClangExpressionVariableSP; - typedef STD_SHARED_PTR(lldb_private::CommandObject) CommandObjectSP; - typedef STD_SHARED_PTR(lldb_private::Communication) CommunicationSP; - typedef STD_SHARED_PTR(lldb_private::Connection) ConnectionSP; - typedef STD_SHARED_PTR(lldb_private::CompileUnit) CompUnitSP; - typedef STD_SHARED_PTR(lldb_private::DataBuffer) DataBufferSP; - typedef STD_SHARED_PTR(lldb_private::DataExtractor) DataExtractorSP; - typedef STD_SHARED_PTR(lldb_private::Debugger) DebuggerSP; - typedef STD_WEAK_PTR( lldb_private::Debugger) DebuggerWP; - typedef STD_SHARED_PTR(lldb_private::Disassembler) DisassemblerSP; - typedef STD_SHARED_PTR(lldb_private::DynamicLibrary) DynamicLibrarySP; - typedef STD_SHARED_PTR(lldb_private::DynamicLoader) DynamicLoaderSP; - typedef STD_SHARED_PTR(lldb_private::Event) EventSP; - typedef STD_SHARED_PTR(lldb_private::ExecutionContextRef) ExecutionContextRefSP; - typedef STD_SHARED_PTR(lldb_private::Function) FunctionSP; - typedef STD_SHARED_PTR(lldb_private::FuncUnwinders) FuncUnwindersSP; - typedef STD_SHARED_PTR(lldb_private::InlineFunctionInfo) InlineFunctionInfoSP; - typedef STD_SHARED_PTR(lldb_private::InputReader) InputReaderSP; - typedef STD_SHARED_PTR(lldb_private::Instruction) InstructionSP; - typedef STD_SHARED_PTR(lldb_private::LanguageRuntime) LanguageRuntimeSP; - typedef STD_SHARED_PTR(lldb_private::LineTable) LineTableSP; - typedef STD_SHARED_PTR(lldb_private::Listener) ListenerSP; - typedef STD_SHARED_PTR(lldb_private::LogChannel) LogChannelSP; - typedef STD_SHARED_PTR(lldb_private::Module) ModuleSP; - typedef STD_WEAK_PTR( lldb_private::Module) ModuleWP; - typedef STD_SHARED_PTR(lldb_private::ObjectFile) ObjectFileSP; - typedef STD_WEAK_PTR( lldb_private::ObjectFile) ObjectFileWP; - typedef STD_SHARED_PTR(lldb_private::OptionValue) OptionValueSP; - typedef STD_WEAK_PTR( lldb_private::OptionValue) OptionValueWP; - typedef STD_SHARED_PTR(lldb_private::OptionValueArch) OptionValueArchSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueArgs) OptionValueArgsSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueArray) OptionValueArraySP; - typedef STD_SHARED_PTR(lldb_private::OptionValueBoolean) OptionValueBooleanSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueDictionary) OptionValueDictionarySP; - typedef STD_SHARED_PTR(lldb_private::OptionValueFileSpec) OptionValueFileSpecSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueFileSpecList) OptionValueFileSpecListSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueFormat) OptionValueFormatSP; - typedef STD_SHARED_PTR(lldb_private::OptionValuePathMappings) OptionValuePathMappingsSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueProperties) OptionValuePropertiesSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueRegex) OptionValueRegexSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueSInt64) OptionValueSInt64SP; - typedef STD_SHARED_PTR(lldb_private::OptionValueString) OptionValueStringSP; - typedef STD_SHARED_PTR(lldb_private::OptionValueUInt64) OptionValueUInt64SP; - typedef STD_SHARED_PTR(lldb_private::OptionValueUUID) OptionValueUUIDSP; - typedef STD_SHARED_PTR(lldb_private::Platform) PlatformSP; - typedef STD_SHARED_PTR(lldb_private::Process) ProcessSP; - typedef STD_SHARED_PTR(lldb_private::ProcessAttachInfo) ProcessAttachInfoSP; - typedef STD_SHARED_PTR(lldb_private::ProcessLaunchInfo) ProcessLaunchInfoSP; - typedef STD_WEAK_PTR( lldb_private::Process) ProcessWP; - typedef STD_SHARED_PTR(lldb_private::Property) PropertySP; - typedef STD_SHARED_PTR(lldb_private::RegisterContext) RegisterContextSP; - typedef STD_SHARED_PTR(lldb_private::RegularExpression) RegularExpressionSP; - typedef STD_SHARED_PTR(lldb_private::ScriptInterpreterObject) ScriptInterpreterObjectSP; + typedef std::shared_ptr<lldb_private::ABI> ABISP; + typedef std::shared_ptr<lldb_private::Baton> BatonSP; + typedef std::shared_ptr<lldb_private::Block> BlockSP; + typedef std::shared_ptr<lldb_private::Breakpoint> BreakpointSP; + typedef std::weak_ptr<lldb_private::Breakpoint> BreakpointWP; + typedef std::shared_ptr<lldb_private::BreakpointSite> BreakpointSiteSP; + typedef std::weak_ptr<lldb_private::BreakpointSite> BreakpointSiteWP; + typedef std::shared_ptr<lldb_private::BreakpointLocation> BreakpointLocationSP; + typedef std::weak_ptr<lldb_private::BreakpointLocation> BreakpointLocationWP; + typedef std::shared_ptr<lldb_private::BreakpointResolver> BreakpointResolverSP; + typedef std::shared_ptr<lldb_private::Broadcaster> BroadcasterSP; + typedef std::shared_ptr<lldb_private::ClangExpressionVariable> ClangExpressionVariableSP; + typedef std::shared_ptr<lldb_private::CommandObject> CommandObjectSP; + typedef std::shared_ptr<lldb_private::Communication> CommunicationSP; + typedef std::shared_ptr<lldb_private::Connection> ConnectionSP; + typedef std::shared_ptr<lldb_private::CompileUnit> CompUnitSP; + typedef std::shared_ptr<lldb_private::DataBuffer> DataBufferSP; + typedef std::shared_ptr<lldb_private::DataExtractor> DataExtractorSP; + typedef std::shared_ptr<lldb_private::Debugger> DebuggerSP; + typedef std::weak_ptr<lldb_private::Debugger> DebuggerWP; + typedef std::shared_ptr<lldb_private::Disassembler> DisassemblerSP; + typedef std::shared_ptr<lldb_private::DynamicLibrary> DynamicLibrarySP; + typedef std::shared_ptr<lldb_private::DynamicLoader> DynamicLoaderSP; + typedef std::shared_ptr<lldb_private::Event> EventSP; + typedef std::shared_ptr<lldb_private::ExecutionContextRef> ExecutionContextRefSP; + typedef std::shared_ptr<lldb_private::Function> FunctionSP; + typedef std::shared_ptr<lldb_private::FuncUnwinders> FuncUnwindersSP; + typedef std::shared_ptr<lldb_private::InlineFunctionInfo> InlineFunctionInfoSP; + typedef std::shared_ptr<lldb_private::InputReader> InputReaderSP; + typedef std::shared_ptr<lldb_private::Instruction> InstructionSP; + typedef std::shared_ptr<lldb_private::LanguageRuntime> LanguageRuntimeSP; + typedef std::shared_ptr<lldb_private::LineTable> LineTableSP; + typedef std::shared_ptr<lldb_private::Listener> ListenerSP; + typedef std::shared_ptr<lldb_private::LogChannel> LogChannelSP; + typedef std::shared_ptr<lldb_private::Module> ModuleSP; + typedef std::weak_ptr<lldb_private::Module> ModuleWP; + typedef std::shared_ptr<lldb_private::ObjectFile> ObjectFileSP; + typedef std::weak_ptr<lldb_private::ObjectFile> ObjectFileWP; + typedef std::shared_ptr<lldb_private::OptionValue> OptionValueSP; + typedef std::weak_ptr<lldb_private::OptionValue> OptionValueWP; + typedef std::shared_ptr<lldb_private::OptionValueArch> OptionValueArchSP; + typedef std::shared_ptr<lldb_private::OptionValueArgs> OptionValueArgsSP; + typedef std::shared_ptr<lldb_private::OptionValueArray> OptionValueArraySP; + typedef std::shared_ptr<lldb_private::OptionValueBoolean> OptionValueBooleanSP; + typedef std::shared_ptr<lldb_private::OptionValueDictionary> OptionValueDictionarySP; + typedef std::shared_ptr<lldb_private::OptionValueFileSpec> OptionValueFileSpecSP; + typedef std::shared_ptr<lldb_private::OptionValueFileSpecList> OptionValueFileSpecListSP; + typedef std::shared_ptr<lldb_private::OptionValueFormat> OptionValueFormatSP; + typedef std::shared_ptr<lldb_private::OptionValuePathMappings> OptionValuePathMappingsSP; + typedef std::shared_ptr<lldb_private::OptionValueProperties> OptionValuePropertiesSP; + typedef std::shared_ptr<lldb_private::OptionValueRegex> OptionValueRegexSP; + typedef std::shared_ptr<lldb_private::OptionValueSInt64> OptionValueSInt64SP; + typedef std::shared_ptr<lldb_private::OptionValueString> OptionValueStringSP; + typedef std::shared_ptr<lldb_private::OptionValueUInt64> OptionValueUInt64SP; + typedef std::shared_ptr<lldb_private::OptionValueUUID> OptionValueUUIDSP; + typedef std::shared_ptr<lldb_private::Platform> PlatformSP; + typedef std::shared_ptr<lldb_private::Process> ProcessSP; + typedef std::shared_ptr<lldb_private::ProcessAttachInfo> ProcessAttachInfoSP; + typedef std::shared_ptr<lldb_private::ProcessLaunchInfo> ProcessLaunchInfoSP; + typedef std::weak_ptr<lldb_private::Process> ProcessWP; + typedef std::shared_ptr<lldb_private::Property> PropertySP; + typedef std::shared_ptr<lldb_private::RegisterContext> RegisterContextSP; + typedef std::shared_ptr<lldb_private::RegularExpression> RegularExpressionSP; + typedef std::shared_ptr<lldb_private::ScriptInterpreterObject> ScriptInterpreterObjectSP; #ifndef LLDB_DISABLE_PYTHON - typedef STD_SHARED_PTR(lldb_private::ScriptSummaryFormat) ScriptSummaryFormatSP; + typedef std::shared_ptr<lldb_private::ScriptSummaryFormat> ScriptSummaryFormatSP; #endif // #ifndef LLDB_DISABLE_PYTHON - typedef STD_SHARED_PTR(lldb_private::Section) SectionSP; - typedef STD_WEAK_PTR( lldb_private::Section) SectionWP; - typedef STD_SHARED_PTR(lldb_private::SearchFilter) SearchFilterSP; - typedef STD_SHARED_PTR(lldb_private::Settings) SettingsSP; - typedef STD_SHARED_PTR(lldb_private::StackFrame) StackFrameSP; - typedef STD_WEAK_PTR( lldb_private::StackFrame) StackFrameWP; - typedef STD_SHARED_PTR(lldb_private::StackFrameList) StackFrameListSP; - typedef STD_SHARED_PTR(lldb_private::StopInfo) StopInfoSP; - typedef STD_SHARED_PTR(lldb_private::StoppointLocation) StoppointLocationSP; - typedef STD_SHARED_PTR(lldb_private::Stream) StreamSP; - typedef STD_WEAK_PTR (lldb_private::Stream) StreamWP; - typedef STD_SHARED_PTR(lldb_private::StringSummaryFormat) StringTypeSummaryImplSP; - typedef STD_SHARED_PTR(lldb_private::SymbolFile) SymbolFileSP; - typedef STD_SHARED_PTR(lldb_private::SymbolFileType) SymbolFileTypeSP; - typedef STD_WEAK_PTR( lldb_private::SymbolFileType) SymbolFileTypeWP; - typedef STD_SHARED_PTR(lldb_private::SymbolContextSpecifier) SymbolContextSpecifierSP; - typedef STD_SHARED_PTR(lldb_private::SyntheticChildren) SyntheticChildrenSP; - typedef STD_SHARED_PTR(lldb_private::SyntheticChildrenFrontEnd) SyntheticChildrenFrontEndSP; - typedef STD_SHARED_PTR(lldb_private::Target) TargetSP; - typedef STD_WEAK_PTR( lldb_private::Target) TargetWP; - typedef STD_SHARED_PTR(lldb_private::Thread) ThreadSP; - typedef STD_WEAK_PTR( lldb_private::Thread) ThreadWP; - typedef STD_SHARED_PTR(lldb_private::ThreadPlan) ThreadPlanSP; - typedef STD_SHARED_PTR(lldb_private::ThreadPlanTracer) ThreadPlanTracerSP; - typedef STD_SHARED_PTR(lldb_private::Type) TypeSP; - typedef STD_WEAK_PTR( lldb_private::Type) TypeWP; - typedef STD_SHARED_PTR(lldb_private::TypeCategoryImpl) TypeCategoryImplSP; - typedef STD_SHARED_PTR(lldb_private::TypeImpl) TypeImplSP; - typedef STD_SHARED_PTR(lldb_private::TypeFilterImpl) TypeFilterImplSP; - typedef STD_SHARED_PTR(lldb_private::TypeFormatImpl) TypeFormatImplSP; - typedef STD_SHARED_PTR(lldb_private::TypeNameSpecifierImpl) TypeNameSpecifierImplSP; - typedef STD_SHARED_PTR(lldb_private::TypeSummaryImpl) TypeSummaryImplSP; + typedef std::shared_ptr<lldb_private::Section> SectionSP; + typedef std::weak_ptr<lldb_private::Section> SectionWP; + typedef std::shared_ptr<lldb_private::SearchFilter> SearchFilterSP; + typedef std::shared_ptr<lldb_private::Settings> SettingsSP; + typedef std::shared_ptr<lldb_private::StackFrame> StackFrameSP; + typedef std::weak_ptr<lldb_private::StackFrame> StackFrameWP; + typedef std::shared_ptr<lldb_private::StackFrameList> StackFrameListSP; + typedef std::shared_ptr<lldb_private::StopInfo> StopInfoSP; + typedef std::shared_ptr<lldb_private::StoppointLocation> StoppointLocationSP; + typedef std::shared_ptr<lldb_private::Stream> StreamSP; + typedef std::weak_ptr<lldb_private::Stream> StreamWP; + typedef std::shared_ptr<lldb_private::StringSummaryFormat> StringTypeSummaryImplSP; + typedef std::shared_ptr<lldb_private::SymbolFile> SymbolFileSP; + typedef std::shared_ptr<lldb_private::SymbolFileType> SymbolFileTypeSP; + typedef std::weak_ptr<lldb_private::SymbolFileType> SymbolFileTypeWP; + typedef std::shared_ptr<lldb_private::SymbolContextSpecifier> SymbolContextSpecifierSP; + typedef std::shared_ptr<lldb_private::SyntheticChildren> SyntheticChildrenSP; + typedef std::shared_ptr<lldb_private::SyntheticChildrenFrontEnd> SyntheticChildrenFrontEndSP; + typedef std::shared_ptr<lldb_private::Target> TargetSP; + typedef std::weak_ptr<lldb_private::Target> TargetWP; + typedef std::shared_ptr<lldb_private::Thread> ThreadSP; + typedef std::weak_ptr<lldb_private::Thread> ThreadWP; + typedef std::shared_ptr<lldb_private::ThreadPlan> ThreadPlanSP; + typedef std::shared_ptr<lldb_private::ThreadPlanTracer> ThreadPlanTracerSP; + typedef std::shared_ptr<lldb_private::Type> TypeSP; + typedef std::weak_ptr<lldb_private::Type> TypeWP; + typedef std::shared_ptr<lldb_private::TypeCategoryImpl> TypeCategoryImplSP; + typedef std::shared_ptr<lldb_private::TypeImpl> TypeImplSP; + typedef std::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP; + typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP; + typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP; + typedef std::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP; #ifndef LLDB_DISABLE_PYTHON - typedef STD_SHARED_PTR(lldb_private::ScriptedSyntheticChildren) ScriptedSyntheticChildrenSP; + typedef std::shared_ptr<lldb_private::ScriptedSyntheticChildren> ScriptedSyntheticChildrenSP; #endif - typedef STD_SHARED_PTR(lldb_private::UnwindPlan) UnwindPlanSP; + typedef std::shared_ptr<lldb_private::UnwindPlan> UnwindPlanSP; typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP; - typedef STD_SHARED_PTR(lldb_private::Value) ValueSP; - typedef STD_SHARED_PTR(lldb_private::ValueList) ValueListSP; - typedef STD_SHARED_PTR(lldb_private::Variable) VariableSP; - typedef STD_SHARED_PTR(lldb_private::VariableList) VariableListSP; - typedef STD_SHARED_PTR(lldb_private::ValueObjectList) ValueObjectListSP; - typedef STD_SHARED_PTR(lldb_private::Watchpoint) WatchpointSP; + typedef std::shared_ptr<lldb_private::Value> ValueSP; + typedef std::shared_ptr<lldb_private::ValueList> ValueListSP; + typedef std::shared_ptr<lldb_private::Variable> VariableSP; + typedef std::shared_ptr<lldb_private::VariableList> VariableListSP; + typedef std::shared_ptr<lldb_private::ValueObjectList> ValueObjectListSP; + typedef std::shared_ptr<lldb_private::Watchpoint> WatchpointSP; } // namespace lldb diff --git a/lldb/scripts/Python/interface/SBExpressionOptions.i b/lldb/scripts/Python/interface/SBExpressionOptions.i index 881903d588d..703d51c8483 100644 --- a/lldb/scripts/Python/interface/SBExpressionOptions.i +++ b/lldb/scripts/Python/interface/SBExpressionOptions.i @@ -83,7 +83,7 @@ protected: private: // This auto_pointer is made in the constructor and is always valid. - mutable STD_UNIQUE_PTR(lldb_private::EvaluateExpressionOptions) m_opaque_ap; + mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap; }; } // namespace lldb diff --git a/lldb/scripts/Python/interface/SBSection.i b/lldb/scripts/Python/interface/SBSection.i index e4966acd18a..94b5800e1bd 100644 --- a/lldb/scripts/Python/interface/SBSection.i +++ b/lldb/scripts/Python/interface/SBSection.i @@ -122,7 +122,7 @@ public: private: - STD_UNIQUE_PTR(lldb_private::SectionImpl) m_opaque_ap; + std::unique_ptr<lldb_private::SectionImpl> m_opaque_ap; }; } // namespace lldb diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index bf1baab3785..c4d40f76091 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -65,7 +65,7 @@ public: %} protected: - STD_UNIQUE_PTR(lldb_private::TypeMemberImpl) m_opaque_ap; + std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap; }; %feature("docstring", diff --git a/lldb/source/API/SBTypeCategory.cpp b/lldb/source/API/SBTypeCategory.cpp index 03b02fababa..e3978693c81 100644 --- a/lldb/source/API/SBTypeCategory.cpp +++ b/lldb/source/API/SBTypeCategory.cpp @@ -169,7 +169,7 @@ SBTypeCategory::GetFilterForType (SBTypeNameSpecifier spec) if (!children_sp) return lldb::SBTypeFilter(); - TypeFilterImplSP filter_sp = STD_STATIC_POINTER_CAST(TypeFilterImpl,children_sp); + TypeFilterImplSP filter_sp = std::static_pointer_cast<TypeFilterImpl>(children_sp); return lldb::SBTypeFilter(filter_sp); @@ -233,7 +233,7 @@ SBTypeCategory::GetSyntheticForType (SBTypeNameSpecifier spec) if (!children_sp) return lldb::SBTypeSynthetic(); - ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp); + ScriptedSyntheticChildrenSP synth_sp = std::static_pointer_cast<ScriptedSyntheticChildren>(children_sp); return lldb::SBTypeSynthetic(synth_sp); } @@ -250,7 +250,7 @@ SBTypeCategory::GetFilterAtIndex (uint32_t index) if (!children_sp.get()) return lldb::SBTypeFilter(); - TypeFilterImplSP filter_sp = STD_STATIC_POINTER_CAST(TypeFilterImpl,children_sp); + TypeFilterImplSP filter_sp = std::static_pointer_cast<TypeFilterImpl>(children_sp); return lldb::SBTypeFilter(filter_sp); } @@ -285,7 +285,7 @@ SBTypeCategory::GetSyntheticAtIndex (uint32_t index) if (!children_sp.get()) return lldb::SBTypeSynthetic(); - ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp); + ScriptedSyntheticChildrenSP synth_sp = std::static_pointer_cast<ScriptedSyntheticChildren>(children_sp); return lldb::SBTypeSynthetic(synth_sp); } diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 41c12a5689e..435dcff7a3e 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -708,7 +708,7 @@ SBValue::GetTypeFilter () if (synthetic_sp && !synthetic_sp->IsScripted()) { - TypeFilterImplSP filter_sp = STD_STATIC_POINTER_CAST(TypeFilterImpl,synthetic_sp); + TypeFilterImplSP filter_sp = std::static_pointer_cast<TypeFilterImpl>(synthetic_sp); filter.SetSP(filter_sp); } } @@ -746,7 +746,7 @@ SBValue::GetTypeSynthetic () if (children_sp && children_sp->IsScripted()) { - ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp); + ScriptedSyntheticChildrenSP synth_sp = std::static_pointer_cast<ScriptedSyntheticChildren>(children_sp); synthetic.SetSP(synth_sp); } } diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index da73ec64677..0d6a3a7264d 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -206,7 +206,7 @@ one command per line.\n" ); CommandReturnObject &result) { InputReaderSP reader_sp (new InputReader(m_interpreter.GetDebugger())); - STD_UNIQUE_PTR(BreakpointOptions::CommandData) data_ap(new BreakpointOptions::CommandData()); + std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); if (reader_sp && data_ap.get()) { BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); @@ -242,7 +242,7 @@ one command per line.\n" ); SetBreakpointCommandCallback (BreakpointOptions *bp_options, const char *oneliner) { - STD_UNIQUE_PTR(BreakpointOptions::CommandData) data_ap(new BreakpointOptions::CommandData()); + std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); // It's necessary to set both user_source and script_source to the oneliner. // The former is used to generate callback description (as in breakpoint command list) diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index d322d8c36f9..75bcfc2cca7 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1066,7 +1066,7 @@ protected: } private: - STD_UNIQUE_PTR(CommandObjectRegexCommand) m_regex_cmd_ap; + std::unique_ptr<CommandObjectRegexCommand> m_regex_cmd_ap; class CommandOptions : public Options { diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index ff0b04e4082..1c7a6d0439e 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -4882,7 +4882,7 @@ protected: target->AddStopHook (new_hook_sp); // First step, make the specifier. - STD_UNIQUE_PTR(SymbolContextSpecifier) specifier_ap; + std::unique_ptr<SymbolContextSpecifier> specifier_ap; if (m_options.m_sym_ctx_specified) { specifier_ap.reset(new SymbolContextSpecifier(m_interpreter.GetDebugger().GetSelectedTarget())); diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 45f9e7c2535..1fa364f35ae 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -61,7 +61,7 @@ public: { } - typedef STD_SHARED_PTR(ScriptAddOptions) SharedPointer; + typedef std::shared_ptr<ScriptAddOptions> SharedPointer; }; @@ -94,7 +94,7 @@ public: { } - typedef STD_SHARED_PTR(SynthAddOptions) SharedPointer; + typedef std::shared_ptr<SynthAddOptions> SharedPointer; }; diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index 86bab6b19fd..ac86025cc7f 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -190,7 +190,7 @@ but do NOT enter more than one command per line. \n" ); CommandReturnObject &result) { InputReaderSP reader_sp (new InputReader(m_interpreter.GetDebugger())); - STD_UNIQUE_PTR(WatchpointOptions::CommandData) data_ap(new WatchpointOptions::CommandData()); + std::unique_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData()); if (reader_sp && data_ap.get()) { BatonSP baton_sp (new WatchpointOptions::CommandBaton (data_ap.release())); @@ -226,7 +226,7 @@ but do NOT enter more than one command per line. \n" ); SetWatchpointCommandCallback (WatchpointOptions *wp_options, const char *oneliner) { - STD_UNIQUE_PTR(WatchpointOptions::CommandData) data_ap(new WatchpointOptions::CommandData()); + std::unique_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData()); // It's necessary to set both user_source and script_source to the oneliner. // The former is used to generate callback description (as in watchpoint command list) diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index f2782bc49ad..f06062ec653 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -638,7 +638,7 @@ Instruction::Dump (lldb_private::Stream *s, bool Instruction::DumpEmulation (const ArchSpec &arch) { - STD_UNIQUE_PTR(EmulateInstruction) insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); + std::unique_ptr<EmulateInstruction> insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); if (insn_emulator_ap.get()) { insn_emulator_ap->SetInstruction (GetOpcode(), GetAddress(), NULL); @@ -904,7 +904,7 @@ Instruction::TestEmulation (Stream *out_stream, const char *file_name) arch.SetTriple (llvm::Triple (value_sp->GetStringValue())); bool success = false; - STD_UNIQUE_PTR(EmulateInstruction) insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); + std::unique_ptr<EmulateInstruction> insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); if (insn_emulator_ap.get()) success = insn_emulator_ap->TestEmulation (out_stream, arch, data_dictionary); @@ -925,7 +925,7 @@ Instruction::Emulate (const ArchSpec &arch, EmulateInstruction::ReadRegisterCallback read_reg_callback, EmulateInstruction::WriteRegisterCallback write_reg_callback) { - STD_UNIQUE_PTR(EmulateInstruction) insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); + std::unique_ptr<EmulateInstruction> insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL)); if (insn_emulator_ap.get()) { insn_emulator_ap->SetBaton (baton); diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp index 1e52acce38c..1943c80b2f0 100644 --- a/lldb/source/Core/DynamicLoader.cpp +++ b/lldb/source/Core/DynamicLoader.cpp @@ -24,7 +24,7 @@ DynamicLoader::FindPlugin (Process *process, const char *plugin_name) create_callback = PluginManager::GetDynamicLoaderCreateCallbackForPluginName (plugin_name); if (create_callback) { - STD_UNIQUE_PTR(DynamicLoader) instance_ap(create_callback(process, true)); + std::unique_ptr<DynamicLoader> instance_ap(create_callback(process, true)); if (instance_ap.get()) return instance_ap.release(); } @@ -33,7 +33,7 @@ DynamicLoader::FindPlugin (Process *process, const char *plugin_name) { for (uint32_t idx = 0; (create_callback = PluginManager::GetDynamicLoaderCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(DynamicLoader) instance_ap(create_callback(process, false)); + std::unique_ptr<DynamicLoader> instance_ap(create_callback(process, false)); if (instance_ap.get()) return instance_ap.release(); } diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 3c1dfbfb3c6..3408d7f714c 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -254,7 +254,7 @@ Module::GetMemoryObjectFile (const lldb::ProcessSP &process_sp, lldb::addr_t hea if (process_sp) { m_did_load_objfile = true; - STD_UNIQUE_PTR(DataBufferHeap) data_ap (new DataBufferHeap (512, 0)); + std::unique_ptr<DataBufferHeap> data_ap (new DataBufferHeap (512, 0)); Error readmem_error; const size_t bytes_read = process_sp->ReadMemory (header_addr, data_ap->GetBytes(), diff --git a/lldb/source/Core/StreamAsynchronousIO.cpp b/lldb/source/Core/StreamAsynchronousIO.cpp index 5e14d13e9a6..b9e5cdfde72 100644 --- a/lldb/source/Core/StreamAsynchronousIO.cpp +++ b/lldb/source/Core/StreamAsynchronousIO.cpp @@ -35,7 +35,7 @@ StreamAsynchronousIO::Flush () { if (m_accumulated_data.GetSize() > 0) { - STD_UNIQUE_PTR(EventDataBytes) data_bytes_ap (new EventDataBytes); + std::unique_ptr<EventDataBytes> data_bytes_ap (new EventDataBytes); // Let's swap the bytes to avoid LARGE string copies. data_bytes_ap->SwapBytes (m_accumulated_data.GetString()); EventSP new_event_sp (new Event (m_broadcast_event_type, data_bytes_ap.release())); diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index ca7da77f719..754b6ee34b9 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1164,7 +1164,7 @@ ClangExpressionDeclMap::LookupDecl (clang::NamedDecl *decl, ClangExpressionVaria if (parser_vars->m_lldb_var) { - STD_UNIQUE_PTR(Value) value(GetVariableValue(parser_vars->m_lldb_var, NULL)); + std::unique_ptr<Value> value(GetVariableValue(parser_vars->m_lldb_var, NULL)); if (is_reference && value.get() && value->GetValueType() == Value::eValueTypeLoadAddress) { @@ -1299,7 +1299,7 @@ ClangExpressionDeclMap::GetSpecialValue (const ConstString &name) !var->LocationIsValidForFrame (frame)) return Value(); - STD_UNIQUE_PTR(Value) value(GetVariableValue(var, NULL)); + std::unique_ptr<Value> value(GetVariableValue(var, NULL)); if (value.get() && value->GetValueType() == Value::eValueTypeLoadAddress) { @@ -1394,7 +1394,7 @@ ClangExpressionDeclMap::GetObjectPointer return false; } - STD_UNIQUE_PTR(lldb_private::Value) location_value(GetVariableValue(object_ptr_var, + std::unique_ptr<lldb_private::Value> location_value(GetVariableValue(object_ptr_var, NULL)); if (!location_value.get()) @@ -2583,7 +2583,7 @@ ClangExpressionDeclMap::GetVariableValue DWARFExpression &var_location_expr = var->LocationExpression(); - STD_UNIQUE_PTR(Value) var_location(new Value); + std::unique_ptr<Value> var_location(new Value); lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS; @@ -2805,7 +2805,7 @@ ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context, m_parser_vars->m_target_info.address_byte_size)); assert (entity.get()); - STD_UNIQUE_PTR(Value) symbol_location(new Value); + std::unique_ptr<Value> symbol_location(new Value); const Address &symbol_address = symbol.GetAddress(); lldb::addr_t symbol_load_addr = symbol_address.GetLoadAddress(target); @@ -2949,7 +2949,7 @@ ClangExpressionDeclMap::AddOneFunction (NameSearchContext &context, Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); NamedDecl *fun_decl = NULL; - STD_UNIQUE_PTR(Value) fun_location(new Value); + std::unique_ptr<Value> fun_location(new Value); const Address *fun_address = NULL; // only valid for Functions, not for Symbols diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp index 5e4b934822b..431900fbb28 100644 --- a/lldb/source/Expression/ClangExpressionParser.cpp +++ b/lldb/source/Expression/ClangExpressionParser.cpp @@ -352,7 +352,7 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope, m_selector_table.reset(new SelectorTable()); m_builtin_context.reset(new Builtin::Context()); - STD_UNIQUE_PTR(clang::ASTContext) ast_context(new ASTContext(m_compiler->getLangOpts(), + std::unique_ptr<clang::ASTContext> ast_context(new ASTContext(m_compiler->getLangOpts(), m_compiler->getSourceManager(), &m_compiler->getTarget(), m_compiler->getPreprocessor().getIdentifierTable(), @@ -463,7 +463,7 @@ static bool FindFunctionInModule (ConstString &mangled_name, Error ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_addr, lldb::addr_t &func_end, - STD_UNIQUE_PTR(IRExecutionUnit) &execution_unit_ap, + std::unique_ptr<IRExecutionUnit> &execution_unit_ap, ExecutionContext &exe_ctx, bool &can_interpret, ExecutionPolicy execution_policy) @@ -472,11 +472,11 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_addr, func_end = LLDB_INVALID_ADDRESS; Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - STD_UNIQUE_PTR(llvm::ExecutionEngine) execution_engine_ap; + std::unique_ptr<llvm::ExecutionEngine> execution_engine_ap; Error err; - STD_UNIQUE_PTR(llvm::Module) module_ap (m_code_generator->ReleaseModule()); + std::unique_ptr<llvm::Module> module_ap (m_code_generator->ReleaseModule()); if (!module_ap.get()) { diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 083f67aa2cf..da1996a9339 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -396,7 +396,7 @@ ClangUserExpression::Parse (Stream &error_stream, ApplyObjcCastHack(m_expr_text); //ApplyUnicharHack(m_expr_text); - STD_UNIQUE_PTR(ExpressionSourceCode) source_code (ExpressionSourceCode::CreateWrapped(m_expr_prefix.c_str(), m_expr_text.c_str())); + std::unique_ptr<ExpressionSourceCode> source_code (ExpressionSourceCode::CreateWrapped(m_expr_prefix.c_str(), m_expr_text.c_str())); lldb::LanguageType lang_type; diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index c3451a49590..7951965ffec 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -1062,7 +1062,7 @@ DWARFExpression::Update_DW_OP_addr (lldb::addr_t file_addr) // we then replace the data for this expression // So first we copy the data into a heap buffer - STD_UNIQUE_PTR(DataBufferHeap) head_data_ap (new DataBufferHeap (m_data.GetDataStart(), + std::unique_ptr<DataBufferHeap> head_data_ap (new DataBufferHeap (m_data.GetDataStart(), m_data.GetByteSize())); // Make en encoder so we can write the address into the buffer using diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index d6dfe949731..c5e6f7c7481 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -25,8 +25,8 @@ using namespace lldb_private; -IRExecutionUnit::IRExecutionUnit (STD_UNIQUE_PTR(llvm::LLVMContext) &context_ap, - STD_UNIQUE_PTR(llvm::Module) &module_ap, +IRExecutionUnit::IRExecutionUnit (std::unique_ptr<llvm::LLVMContext> &context_ap, + std::unique_ptr<llvm::Module> &module_ap, ConstString &name, const lldb::TargetSP &target_sp, std::vector<std::string> &cpu_features) : diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp index f818123c296..d0512192a37 100644 --- a/lldb/source/Host/common/File.cpp +++ b/lldb/source/Host/common/File.cpp @@ -556,7 +556,7 @@ File::Read (size_t &num_bytes, off_t &offset, bool null_terminate, DataBufferSP if (num_bytes > bytes_left) num_bytes = bytes_left; - STD_UNIQUE_PTR(DataBufferHeap) data_heap_ap; + std::unique_ptr<DataBufferHeap> data_heap_ap; data_heap_ap.reset(new DataBufferHeap(num_bytes + (null_terminate ? 1 : 0), '\0')); if (data_heap_ap.get()) diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index fab7ea1eccb..beeb63da6b0 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -744,7 +744,7 @@ DataBufferSP FileSpec::MemoryMapFileContents(off_t file_offset, size_t file_size) const { DataBufferSP data_sp; - STD_UNIQUE_PTR(DataBufferMemoryMap) mmap_data(new DataBufferMemoryMap()); + std::unique_ptr<DataBufferMemoryMap> mmap_data(new DataBufferMemoryMap()); if (mmap_data.get()) { if (mmap_data->MemoryMapFromFileSpec (this, file_offset, file_size) >= file_size) diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 90de94cf10c..6631fafe5a2 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -1313,7 +1313,7 @@ Host::RunShellCommand (const char *command, } // The process monitor callback will delete the 'shell_info_ptr' below... - STD_UNIQUE_PTR(ShellInfo) shell_info_ap (new ShellInfo()); + std::unique_ptr<ShellInfo> shell_info_ap (new ShellInfo()); const bool monitor_signals = false; launch_info.SetMonitorProcessCallback(MonitorShellCommand, shell_info_ap.get(), monitor_signals); diff --git a/lldb/source/Host/freebsd/Host.cpp b/lldb/source/Host/freebsd/Host.cpp index 453bcf5f1cf..7671cce151c 100644 --- a/lldb/source/Host/freebsd/Host.cpp +++ b/lldb/source/Host/freebsd/Host.cpp @@ -294,7 +294,7 @@ Host::GetAuxvData(lldb_private::Process *process) struct ps_strings ps_strings; struct ptrace_io_desc pid; DataBufferSP buf_sp; - STD_UNIQUE_PTR(DataBufferHeap) buf_ap(new DataBufferHeap(1024, 0)); + std::unique_ptr<DataBufferHeap> buf_ap(new DataBufferHeap(1024, 0)); if (::sysctl(mib, 2, &ps_strings_addr, &ps_strings_size, NULL, 0) == 0) { pid.piod_op = PIOD_READ_D; diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index f90345e13aa..cddc5dbb71f 100644 --- a/lldb/source/Host/linux/Host.cpp +++ b/lldb/source/Host/linux/Host.cpp @@ -72,7 +72,7 @@ Host::GetAuxvData(lldb_private::Process *process) return buf_sp; size_t bytes_read = 0; - STD_UNIQUE_PTR(DataBufferHeap) buf_ap(new DataBufferHeap(1024, 0)); + std::unique_ptr<DataBufferHeap> buf_ap(new DataBufferHeap(1024, 0)); for (;;) { size_t avail = buf_ap->GetByteSize() - bytes_read; diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 661512c222b..ed242239ef6 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -391,7 +391,7 @@ CommandInterpreter::LoadCommandDictionary () size_t num_regexes = sizeof break_regexes/sizeof(char *[2]); - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-break", "Set a breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex.", @@ -418,7 +418,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> tbreak_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-tbreak", "Set a one shot breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex.", @@ -449,7 +449,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> attach_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-attach", "Attach to a process id if in decimal, otherwise treat the argument as a process name to attach to.", @@ -467,7 +467,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> down_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-down", "Go down \"n\" frames in the stack (1 frame by default).", @@ -482,7 +482,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> up_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-up", "Go up \"n\" frames in the stack (1 frame by default).", @@ -497,7 +497,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> display_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-display", "Add an expression evaluation stop-hook.", @@ -511,7 +511,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> undisplay_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-undisplay", "Remove an expression evaluation stop-hook.", @@ -525,7 +525,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> connect_gdb_remote_cmd_ap(new CommandObjectRegexCommand (*this, "gdb-remote", "Connect to a remote GDB server. If no hostname is provided, localhost is assumed.", @@ -540,7 +540,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> connect_kdp_remote_cmd_ap(new CommandObjectRegexCommand (*this, "kdp-remote", "Connect to a remote KDP server. udp port 41139 is the default port number.", @@ -555,7 +555,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> bt_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-bt", "Show a backtrace. An optional argument is accepted; if that argument is a number, it specifies the number of frames to display. If that argument is 'all', full backtraces of all threads are displayed.", @@ -575,7 +575,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> list_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-list", "Implements the GDB 'list' command in all of its forms except FILE:FUNCTION and maps them to the appropriate 'source list' commands.", @@ -597,7 +597,7 @@ CommandInterpreter::LoadCommandDictionary () } } - STD_UNIQUE_PTR(CommandObjectRegexCommand) + std::unique_ptr<CommandObjectRegexCommand> env_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-env", "Implements a shortcut to viewing and setting environment variables.", diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 9b4211bd508..8318c4dd9ba 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -901,7 +901,7 @@ Options::HandleOptionArgumentCompletion ) { const OptionDefinition *opt_defs = GetDefinitions(); - STD_UNIQUE_PTR(SearchFilter) filter_ap; + std::unique_ptr<SearchFilter> filter_ap; int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos; int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index; diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 0609cf9978f..67314731df2 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -81,10 +81,10 @@ ScriptInterpreter::LanguageToString (lldb::ScriptLanguage language) return return_value; } -STD_UNIQUE_PTR(ScriptInterpreterLocker) +std::unique_ptr<ScriptInterpreterLocker> ScriptInterpreter::AcquireInterpreterLock () { - return STD_UNIQUE_PTR(ScriptInterpreterLocker)(new ScriptInterpreterLocker()); + return std::unique_ptr<ScriptInterpreterLocker>(new ScriptInterpreterLocker()); } void diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 260a6c3ad3f..eab33c7c6f6 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -1321,7 +1321,7 @@ ScriptInterpreterPython::GenerateBreakpointOptionsCommandCallback case eInputReaderDone: { BreakpointOptions *bp_options = (BreakpointOptions *)baton; - STD_UNIQUE_PTR(BreakpointOptions::CommandData) data_ap(new BreakpointOptions::CommandData()); + std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); data_ap->user_source.AppendList (commands_in_progress); if (data_ap.get()) { @@ -1427,7 +1427,7 @@ ScriptInterpreterPython::GenerateWatchpointOptionsCommandCallback case eInputReaderDone: { WatchpointOptions *wp_options = (WatchpointOptions *)baton; - STD_UNIQUE_PTR(WatchpointOptions::CommandData) data_ap(new WatchpointOptions::CommandData()); + std::unique_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData()); data_ap->user_source.AppendList (commands_in_progress); if (data_ap.get()) { @@ -1534,7 +1534,7 @@ void ScriptInterpreterPython::SetBreakpointCommandCallback (BreakpointOptions *bp_options, const char *oneliner) { - STD_UNIQUE_PTR(BreakpointOptions::CommandData) data_ap(new BreakpointOptions::CommandData()); + std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); // It's necessary to set both user_source and script_source to the oneliner. // The former is used to generate callback description (as in breakpoint command list) @@ -1557,7 +1557,7 @@ void ScriptInterpreterPython::SetWatchpointCommandCallback (WatchpointOptions *wp_options, const char *oneliner) { - STD_UNIQUE_PTR(WatchpointOptions::CommandData) data_ap(new WatchpointOptions::CommandData()); + std::unique_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData()); // It's necessary to set both user_source and script_source to the oneliner. // The former is used to generate callback description (as in watchpoint command list) @@ -2807,10 +2807,10 @@ ScriptInterpreterPython::GetDocumentationForItem(const char* item, std::string& } } -STD_UNIQUE_PTR(ScriptInterpreterLocker) +std::unique_ptr<ScriptInterpreterLocker> ScriptInterpreterPython::AcquireInterpreterLock () { - STD_UNIQUE_PTR(ScriptInterpreterLocker) py_lock(new Locker(this, + std::unique_ptr<ScriptInterpreterLocker> py_lock(new Locker(this, Locker::AcquireLock | Locker::InitSession, Locker::FreeLock | Locker::TearDownSession)); return py_lock; diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index 942af3a4017..49058786a9a 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -792,7 +792,7 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, ProcessSP process_sp (thread.GetProcess()); if (process_sp) { - STD_UNIQUE_PTR(DataBufferHeap) heap_data_ap (new DataBufferHeap(byte_size, 0)); + std::unique_ptr<DataBufferHeap> heap_data_ap (new DataBufferHeap(byte_size, 0)); const ByteOrder byte_order = process_sp->GetByteOrder(); RegisterValue reg_value; if (reg_ctx->ReadRegister(altivec_reg, reg_value)) diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index b9f7936c4e0..8f0a7e08aa6 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -567,7 +567,7 @@ DisassemblerLLVMC::CreateInstance (const ArchSpec &arch, const char *flavor) { if (arch.GetTriple().getArch() != llvm::Triple::UnknownArch) { - STD_UNIQUE_PTR(DisassemblerLLVMC) disasm_ap (new DisassemblerLLVMC(arch, flavor)); + std::unique_ptr<DisassemblerLLVMC> disasm_ap (new DisassemblerLLVMC(arch, flavor)); if (disasm_ap.get() && disasm_ap->IsValid()) return disasm_ap.release(); diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h index 4b9cee2a608..4a265c573d8 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h @@ -55,13 +55,13 @@ class DisassemblerLLVMC : public lldb_private::Disassembler private: bool m_is_valid; - STD_UNIQUE_PTR(llvm::MCContext) m_context_ap; - STD_UNIQUE_PTR(llvm::MCAsmInfo) m_asm_info_ap; - STD_UNIQUE_PTR(llvm::MCSubtargetInfo) m_subtarget_info_ap; - STD_UNIQUE_PTR(llvm::MCInstrInfo) m_instr_info_ap; - STD_UNIQUE_PTR(llvm::MCRegisterInfo) m_reg_info_ap; - STD_UNIQUE_PTR(llvm::MCInstPrinter) m_instr_printer_ap; - STD_UNIQUE_PTR(llvm::MCDisassembler) m_disasm_ap; + std::unique_ptr<llvm::MCContext> m_context_ap; + std::unique_ptr<llvm::MCAsmInfo> m_asm_info_ap; + std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_ap; + std::unique_ptr<llvm::MCInstrInfo> m_instr_info_ap; + std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_ap; + std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_ap; + std::unique_ptr<llvm::MCDisassembler> m_disasm_ap; }; public: @@ -164,8 +164,8 @@ protected: lldb_private::Mutex m_mutex; bool m_data_from_file; - STD_UNIQUE_PTR(LLVMCDisassembler) m_disasm_ap; - STD_UNIQUE_PTR(LLVMCDisassembler) m_alternate_disasm_ap; + std::unique_ptr<LLVMCDisassembler> m_disasm_ap; + std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap; }; #endif // liblldb_DisassemblerLLVM_h_ diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 1160686e8ee..5367a6ddf92 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -116,7 +116,7 @@ public: }; -typedef STD_SHARED_PTR(DynamicLoaderDarwinKernelProperties) DynamicLoaderDarwinKernelPropertiesSP; +typedef std::shared_ptr<DynamicLoaderDarwinKernelProperties> DynamicLoaderDarwinKernelPropertiesSP; static const DynamicLoaderDarwinKernelPropertiesSP & GetGlobalProperties() diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h index 3402afbc585..709eacac161 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h @@ -93,7 +93,7 @@ protected: lldb::addr_t m_entry_point; /// Auxiliary vector of the inferior process. - STD_UNIQUE_PTR(AuxVector) m_auxv; + std::unique_ptr<AuxVector> m_auxv; /// Enables a breakpoint on a function called by the runtime /// linker each time a module is loaded or unloaded. diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index 8bceba69f40..860e633f8eb 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -193,14 +193,14 @@ EmulateInstructionARM::CreateInstance (const ArchSpec &arch, InstructionType ins { if (arch.GetTriple().getArch() == llvm::Triple::arm) { - STD_UNIQUE_PTR(EmulateInstructionARM) emulate_insn_ap (new EmulateInstructionARM (arch)); + std::unique_ptr<EmulateInstructionARM> emulate_insn_ap (new EmulateInstructionARM (arch)); if (emulate_insn_ap.get()) return emulate_insn_ap.release(); } else if (arch.GetTriple().getArch() == llvm::Triple::thumb) { - STD_UNIQUE_PTR(EmulateInstructionARM) emulate_insn_ap (new EmulateInstructionARM (arch)); + std::unique_ptr<EmulateInstructionARM> emulate_insn_ap (new EmulateInstructionARM (arch)); if (emulate_insn_ap.get()) return emulate_insn_ap.release(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h index 7eaf5ac04d4..d198351a6fc 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h @@ -104,9 +104,9 @@ protected: Address * GetPrintForDebuggerAddr(); - STD_UNIQUE_PTR(Address) m_PrintForDebugger_addr; + std::unique_ptr<Address> m_PrintForDebugger_addr; bool m_read_objc_library; - STD_UNIQUE_PTR(lldb_private::AppleObjCTrampolineHandler) m_objc_trampoline_handler_ap; + std::unique_ptr<lldb_private::AppleObjCTrampolineHandler> m_objc_trampoline_handler_ap; lldb::BreakpointSP m_objc_exception_bp_sp; lldb::ModuleWP m_objc_module_wp; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index ca239db43bb..76398f54886 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -150,7 +150,7 @@ struct BufStruct { ClangUtilityFunction * AppleObjCRuntimeV1::CreateObjectChecker(const char *name) { - STD_UNIQUE_PTR(BufStruct) buf(new BufStruct); + std::unique_ptr<BufStruct> buf(new BufStruct); assert(snprintf(&buf->contents[0], sizeof(buf->contents), "struct __objc_class \n" diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h index e84f5ff42ec..9112ebdb35b 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h @@ -184,7 +184,7 @@ protected: HashTableSignature m_hash_signature; lldb::addr_t m_isa_hash_table_ptr; - STD_UNIQUE_PTR(TypeVendor) m_type_vendor_ap; + std::unique_ptr<TypeVendor> m_type_vendor_ap; private: AppleObjCRuntimeV1(Process *process); }; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 7ab38f91770..185f1ddc5e3 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -820,9 +820,9 @@ public: if (process) { - STD_UNIQUE_PTR(objc_class_t) objc_class; - STD_UNIQUE_PTR(class_ro_t) class_ro; - STD_UNIQUE_PTR(class_rw_t) class_rw; + std::unique_ptr<objc_class_t> objc_class; + std::unique_ptr<class_ro_t> class_ro; + std::unique_ptr<class_rw_t> class_rw; if (!Read_objc_class(process, objc_class)) return m_name; @@ -843,7 +843,7 @@ public: if (!process) return ObjCLanguageRuntime::ClassDescriptorSP(); - STD_UNIQUE_PTR(objc_class_t) objc_class; + std::unique_ptr<objc_class_t> objc_class; if (!Read_objc_class(process, objc_class)) return ObjCLanguageRuntime::ClassDescriptorSP(); @@ -872,9 +872,9 @@ public: if (process) { - STD_UNIQUE_PTR(objc_class_t) objc_class; - STD_UNIQUE_PTR(class_ro_t) class_ro; - STD_UNIQUE_PTR(class_rw_t) class_rw; + std::unique_ptr<objc_class_t> objc_class; + std::unique_ptr<class_ro_t> class_ro; + std::unique_ptr<class_rw_t> class_rw; if (!Read_objc_class(process, objc_class)) return 0; @@ -901,9 +901,9 @@ public: { lldb_private::Process *process = m_runtime.GetProcess(); - STD_UNIQUE_PTR(objc_class_t) objc_class; - STD_UNIQUE_PTR(class_ro_t) class_ro; - STD_UNIQUE_PTR(class_rw_t) class_rw; + std::unique_ptr<objc_class_t> objc_class; + std::unique_ptr<class_ro_t> class_ro; + std::unique_ptr<class_rw_t> class_rw; if (!Read_objc_class(process, objc_class)) return 0; @@ -917,7 +917,7 @@ public: if (instance_method_func) { - STD_UNIQUE_PTR(method_list_t) base_method_list; + std::unique_ptr<method_list_t> base_method_list; base_method_list.reset(new method_list_t); if (!base_method_list->Read(process, class_ro->m_baseMethods_ptr)) @@ -926,7 +926,7 @@ public: if (base_method_list->m_entsize != method_t::GetSize(process)) return false; - STD_UNIQUE_PTR(method_t) method; + std::unique_ptr<method_t> method; method.reset(new method_t); for (uint32_t i = 0, e = base_method_list->m_count; i < e; ++i) @@ -1354,7 +1354,7 @@ private: } }; - bool Read_objc_class (Process* process, STD_UNIQUE_PTR(objc_class_t) &objc_class) + bool Read_objc_class (Process* process, std::unique_ptr<objc_class_t> &objc_class) { objc_class.reset(new objc_class_t); @@ -1366,7 +1366,7 @@ private: return ret; } - bool Read_class_row (Process* process, const objc_class_t &objc_class, STD_UNIQUE_PTR(class_ro_t) &class_ro, STD_UNIQUE_PTR(class_rw_t) &class_rw) + bool Read_class_row (Process* process, const objc_class_t &objc_class, std::unique_ptr<class_ro_t> &class_ro, std::unique_ptr<class_rw_t> &class_rw) { class_ro.reset(); class_rw.reset(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h index 07a38fe7d75..b805d3632e0 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -150,17 +150,17 @@ private: lldb::addr_t GetSharedCacheReadOnlyAddress(); - STD_UNIQUE_PTR(ClangFunction) m_get_class_info_function; - STD_UNIQUE_PTR(ClangUtilityFunction) m_get_class_info_code; + std::unique_ptr<ClangFunction> m_get_class_info_function; + std::unique_ptr<ClangUtilityFunction> m_get_class_info_code; lldb::addr_t m_get_class_info_args; Mutex m_get_class_info_args_mutex; - STD_UNIQUE_PTR(ClangFunction) m_get_shared_cache_class_info_function; - STD_UNIQUE_PTR(ClangUtilityFunction) m_get_shared_cache_class_info_code; + std::unique_ptr<ClangFunction> m_get_shared_cache_class_info_function; + std::unique_ptr<ClangUtilityFunction> m_get_shared_cache_class_info_code; lldb::addr_t m_get_shared_cache_class_info_args; Mutex m_get_shared_cache_class_info_args_mutex; - STD_UNIQUE_PTR(TypeVendor) m_type_vendor_ap; + std::unique_ptr<TypeVendor> m_type_vendor_ap; lldb::addr_t m_isa_hash_table_ptr; HashTableSignature m_hash_signature; bool m_has_object_getClass; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h index 0ee4d48d30c..8ac8dad8407 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h @@ -197,14 +197,14 @@ private: MsgsendMap m_msgSend_map; lldb::ProcessSP m_process_sp; lldb::ModuleSP m_objc_module_sp; - STD_UNIQUE_PTR(ClangFunction) m_impl_function; - STD_UNIQUE_PTR(ClangUtilityFunction) m_impl_code; + std::unique_ptr<ClangFunction> m_impl_function; + std::unique_ptr<ClangUtilityFunction> m_impl_code; Mutex m_impl_function_mutex; lldb::addr_t m_impl_fn_addr; lldb::addr_t m_impl_stret_fn_addr; lldb::addr_t m_msg_forward_addr; lldb::addr_t m_msg_forward_stret_addr; - STD_UNIQUE_PTR(AppleObjCVTables) m_vtables_ap; + std::unique_ptr<AppleObjCVTables> m_vtables_ap; }; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 5c87ec276f4..19d17f0033e 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -296,7 +296,7 @@ ObjectContainerBSDArchive::CreateInstance lldb::offset_t archive_data_offset = 0; Archive::shared_ptr archive_sp (Archive::FindCachedArchive (*file, module_sp->GetArchitecture(), module_sp->GetModificationTime())); - STD_UNIQUE_PTR(ObjectContainerBSDArchive) container_ap(new ObjectContainerBSDArchive (module_sp, + std::unique_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module_sp, archive_data_sp, archive_data_offset, file, @@ -322,7 +322,7 @@ ObjectContainerBSDArchive::CreateInstance Archive::shared_ptr archive_sp (Archive::FindCachedArchive (*file, module_sp->GetArchitecture(), module_sp->GetModificationTime())); if (archive_sp) { - STD_UNIQUE_PTR(ObjectContainerBSDArchive) container_ap(new ObjectContainerBSDArchive (module_sp, data_sp, data_offset, file, file_offset, length)); + std::unique_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module_sp, data_sp, data_offset, file, file_offset, length)); if (container_ap.get()) { diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index e6e943bf795..f4bd5d20362 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -119,7 +119,7 @@ protected: class Archive { public: - typedef STD_SHARED_PTR(Archive) shared_ptr; + typedef std::shared_ptr<Archive> shared_ptr; typedef std::multimap<lldb_private::FileSpec, shared_ptr> Map; static Map & diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index fbc64a19b90..9a28736e3e6 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -67,7 +67,7 @@ ObjectContainerUniversalMachO::CreateInstance data.SetData (data_sp, data_offset, length); if (ObjectContainerUniversalMachO::MagicBytesMatch(data)) { - STD_UNIQUE_PTR(ObjectContainerUniversalMachO) container_ap(new ObjectContainerUniversalMachO (module_sp, data_sp, data_offset, file, file_offset, length)); + std::unique_ptr<ObjectContainerUniversalMachO> container_ap(new ObjectContainerUniversalMachO (module_sp, data_sp, data_offset, file, file_offset, length)); if (container_ap->ParseHeader()) { return container_ap.release(); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index cfe9b877d78..0ce96b972d8 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -198,7 +198,7 @@ ObjectFileELF::CreateInstance (const lldb::ModuleSP &module_sp, unsigned address_size = ELFHeader::AddressSizeInBytes(magic); if (address_size == 4 || address_size == 8) { - STD_UNIQUE_PTR(ObjectFileELF) objfile_ap(new ObjectFileELF(module_sp, data_sp, data_offset, file, file_offset, length)); + std::unique_ptr<ObjectFileELF> objfile_ap(new ObjectFileELF(module_sp, data_sp, data_offset, file, file_offset, length)); ArchSpec spec; if (objfile_ap->GetArchitecture(spec) && objfile_ap->SetModulesArchitecture(spec)) diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 0870d90b6bc..66b6f7110c2 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -155,7 +155,7 @@ private: /// List of file specifications corresponding to the modules (shared /// libraries) on which this object file depends. - mutable STD_UNIQUE_PTR(lldb_private::FileSpecList) m_filespec_ap; + mutable std::unique_ptr<lldb_private::FileSpecList> m_filespec_ap; /// Data extractor holding the string table used to resolve section names. lldb_private::DataExtractor m_shstr_data; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 46d63bc8478..90e56054a1f 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -411,7 +411,7 @@ ObjectFileMachO::CreateInstance (const lldb::ModuleSP &module_sp, data_sp = file->MemoryMapFileContents(file_offset, length); data_offset = 0; } - STD_UNIQUE_PTR(ObjectFile) objfile_ap(new ObjectFileMachO (module_sp, data_sp, data_offset, file, file_offset, length)); + std::unique_ptr<ObjectFile> objfile_ap(new ObjectFileMachO (module_sp, data_sp, data_offset, file, file_offset, length)); if (objfile_ap.get() && objfile_ap->ParseHeader()) return objfile_ap.release(); } @@ -426,7 +426,7 @@ ObjectFileMachO::CreateMemoryInstance (const lldb::ModuleSP &module_sp, { if (ObjectFileMachO::MagicBytesMatch(data_sp, 0, data_sp->GetByteSize())) { - STD_UNIQUE_PTR(ObjectFile) objfile_ap(new ObjectFileMachO (module_sp, data_sp, process_sp, header_addr)); + std::unique_ptr<ObjectFile> objfile_ap(new ObjectFileMachO (module_sp, data_sp, process_sp, header_addr)); if (objfile_ap.get() && objfile_ap->ParseHeader()) return objfile_ap.release(); } diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 5982874ad27..4ce198b7ee2 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -163,7 +163,7 @@ ObjectFilePECOFF::CreateInstance (const lldb::ModuleSP &module_sp, // Update the data to contain the entire file if it doesn't already if (data_sp->GetByteSize() < length) data_sp = file->MemoryMapFileContents(file_offset, length); - STD_UNIQUE_PTR(ObjectFile) objfile_ap(new ObjectFilePECOFF (module_sp, data_sp, data_offset, file, file_offset, length)); + std::unique_ptr<ObjectFile> objfile_ap(new ObjectFilePECOFF (module_sp, data_sp, data_offset, file, file_offset, length)); if (objfile_ap.get() && objfile_ap->ParseHeader()) return objfile_ap.release(); } diff --git a/lldb/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h b/lldb/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h index de781d5d17f..b9a7e3ff559 100644 --- a/lldb/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h +++ b/lldb/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h @@ -84,7 +84,7 @@ protected: GetDynamicRegisterInfo (); lldb::ValueObjectSP m_thread_list_valobj_sp; - STD_UNIQUE_PTR(DynamicRegisterInfo) m_register_info_ap; + std::unique_ptr<DynamicRegisterInfo> m_register_info_ap; }; diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index 4127506d6a4..6e2aadb7fde 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -60,7 +60,7 @@ OperatingSystemPython::CreateInstance (Process *process, bool force) FileSpec python_os_plugin_spec (process->GetPythonOSPluginPath()); if (python_os_plugin_spec && python_os_plugin_spec.Exists()) { - STD_UNIQUE_PTR(OperatingSystemPython) os_ap (new OperatingSystemPython (process, python_os_plugin_spec)); + std::unique_ptr<OperatingSystemPython> os_ap (new OperatingSystemPython (process, python_os_plugin_spec)); if (os_ap.get() && os_ap->IsValid()) return os_ap.release(); } diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h index f55cc514f41..756d054cca1 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -101,7 +101,7 @@ protected: GetDynamicRegisterInfo (); lldb::ValueObjectSP m_thread_list_valobj_sp; - STD_UNIQUE_PTR(DynamicRegisterInfo) m_register_info_ap; + std::unique_ptr<DynamicRegisterInfo> m_register_info_ap; lldb_private::ScriptInterpreter *m_interpreter; lldb::ScriptInterpreterObjectSP m_python_object_sp; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 525d0fdaf9e..d41704b86d4 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -224,7 +224,7 @@ public: } }; -typedef STD_SHARED_PTR(PlatformDarwinKernelProperties) PlatformDarwinKernelPropertiesSP; +typedef std::shared_ptr<PlatformDarwinKernelProperties> PlatformDarwinKernelPropertiesSP; static const PlatformDarwinKernelPropertiesSP & GetGlobalProperties() diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index f80e5e0967e..b92e7728f41 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -691,7 +691,7 @@ ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, m_client_fd(-1), m_server_fd(-1) { - STD_UNIQUE_PTR(LaunchArgs) args; + std::unique_ptr<LaunchArgs> args; args.reset(new LaunchArgs(this, module, argv, envp, stdin_path, stdout_path, stderr_path, working_dir)); @@ -752,7 +752,7 @@ ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, m_client_fd(-1), m_server_fd(-1) { - STD_UNIQUE_PTR(AttachArgs) args; + std::unique_ptr<AttachArgs> args; args.reset(new AttachArgs(this, pid)); diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index 269a41ef102..d893b89c6fc 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -924,7 +924,7 @@ ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, m_client_fd(-1), m_server_fd(-1) { - STD_UNIQUE_PTR(LaunchArgs) args; + std::unique_ptr<LaunchArgs> args; args.reset(new LaunchArgs(this, module, argv, envp, stdin_path, stdout_path, stderr_path, working_dir)); @@ -984,7 +984,7 @@ ProcessMonitor::ProcessMonitor(ProcessPOSIX *process, m_client_fd(-1), m_server_fd(-1) { - STD_UNIQUE_PTR(AttachArgs) args; + std::unique_ptr<AttachArgs> args; args.reset(new AttachArgs(this, pid)); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 4d4e5f4876e..9e4cc568af5 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -196,7 +196,7 @@ ProcessKDP::DoConnectRemote (Stream *strm, const char *remote_url) return error; } - STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap(new ConnectionFileDescriptor()); + std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor()); if (conn_ap.get()) { // Only try once for now. diff --git a/lldb/source/Plugins/Process/POSIX/POSIXThread.h b/lldb/source/Plugins/Process/POSIX/POSIXThread.h index d75146e5e17..3a282042997 100644 --- a/lldb/source/Plugins/Process/POSIX/POSIXThread.h +++ b/lldb/source/Plugins/Process/POSIX/POSIXThread.h @@ -81,7 +81,7 @@ private: return (RegisterContextPOSIX *)m_reg_context_sp.get(); } - STD_UNIQUE_PTR(lldb_private::StackFrame) m_frame_ap; + std::unique_ptr<lldb_private::StackFrame> m_frame_ap; lldb::BreakpointSiteSP m_breakpoint; lldb::StopInfoSP m_stop_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h index 572d119446f..dc6d8c61fa4 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h @@ -25,7 +25,7 @@ class UnwindLLDB; class RegisterContextLLDB : public lldb_private::RegisterContext { public: - typedef STD_SHARED_PTR(RegisterContextLLDB) SharedPtr; + typedef std::shared_ptr<RegisterContextLLDB> SharedPtr; RegisterContextLLDB (lldb_private::Thread &thread, const SharedPtr& next_frame, diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h index ed3be5bf5d5..051e6c9cd45 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h @@ -77,7 +77,7 @@ protected: lldb::RegisterContextSP DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame); - typedef STD_SHARED_PTR(RegisterContextLLDB) RegisterContextLLDBSP; + typedef std::shared_ptr<RegisterContextLLDB> RegisterContextLLDBSP; // Needed to retrieve the "next" frame (e.g. frame 2 needs to retrieve frame 1's RegisterContextLLDB) // The RegisterContext for frame_num must already exist or this returns an empty shared pointer. @@ -104,7 +104,7 @@ private: DISALLOW_COPY_AND_ASSIGN (Cursor); }; - typedef STD_SHARED_PTR(Cursor) CursorSP; + typedef std::shared_ptr<Cursor> CursorSP; std::vector<CursorSP> m_frames; bool m_unwind_complete; // If this is true, we've enumerated all the frames in the stack, and m_frames.size() is the // number of frames, etc. Otherwise we've only gone as far as directly asked, and m_frames.size() diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 1d1a0951cbc..257c43a3b25 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -738,7 +738,7 @@ ProcessGDBRemote::ConnectToDebugserver (const char *connect_url) { Error error; // Sleep and wait a bit for debugserver to start to listen... - STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap(new ConnectionFileDescriptor()); + std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor()); if (conn_ap.get()) { const uint32_t max_retry_count = 50; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index 08fe68c2231..9fee0a2d223 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -190,7 +190,7 @@ protected: const DWARFAbbreviationDeclarationSet *m_abbrevs; void * m_user_data; DWARFDebugInfoEntry::collection m_die_array; // The compile unit debug information entry item - STD_UNIQUE_PTR(DWARFDebugAranges) m_func_aranges_ap; // A table similar to the .debug_aranges table, but this one points to the exact DW_TAG_subprogram DIEs + std::unique_ptr<DWARFDebugAranges> m_func_aranges_ap; // A table similar to the .debug_aranges table, but this one points to the exact DW_TAG_subprogram DIEs dw_addr_t m_base_addr; dw_offset_t m_offset; uint32_t m_length; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index 58c295abc24..50a7ae76921 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -21,7 +21,7 @@ typedef std::multimap<const char*, dw_offset_t, CStringCompareFunctionObject> CS typedef CStringToDIEMap::iterator CStringToDIEMapIter; typedef CStringToDIEMap::const_iterator CStringToDIEMapConstIter; -typedef STD_SHARED_PTR(DWARFCompileUnit) DWARFCompileUnitSP; +typedef std::shared_ptr<DWARFCompileUnit> DWARFCompileUnitSP; class DWARFDebugInfo { @@ -77,7 +77,7 @@ protected: SymbolFileDWARF* m_dwarf2Data; typedef std::vector<DWARFCompileUnitSP> CompileUnitColl; CompileUnitColl m_compile_units; - STD_UNIQUE_PTR(DWARFDebugAranges) m_cu_aranges_ap; // A quick address to compile unit table + std::unique_ptr<DWARFDebugAranges> m_cu_aranges_ap; // A quick address to compile unit table private: // All parsing needs to be done partially any managed by this class as accessors are called. diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index ade8f9bd9f7..cfa8654ed9b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -68,7 +68,7 @@ public: { } - typedef STD_SHARED_PTR(Prologue) shared_ptr; + typedef std::shared_ptr<Prologue> shared_ptr; uint32_t total_length; // The size in bytes of the statement information for this compilation unit (not including the total_length field itself). uint16_t version; // Version identifier for the statement information format. @@ -135,7 +135,7 @@ public: //------------------------------------------------------------------ struct LineTable { - typedef STD_SHARED_PTR(LineTable) shared_ptr; + typedef std::shared_ptr<LineTable> shared_ptr; LineTable() : prologue(), diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 778f9e252a7..3583779604f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -880,7 +880,7 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile func_name.SetValue(ConstString(name), false); FunctionSP func_sp; - STD_UNIQUE_PTR(Declaration) decl_ap; + std::unique_ptr<Declaration> decl_ap; if (decl_file != 0 || decl_line != 0 || decl_column != 0) decl_ap.reset(new Declaration (sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(decl_file), decl_line, @@ -995,7 +995,7 @@ SymbolFileDWARF::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpec struct ParseDWARFLineTableCallbackInfo { LineTable* line_table; - STD_UNIQUE_PTR(LineSequence) sequence_ap; + std::unique_ptr<LineSequence> sequence_ap; }; //---------------------------------------------------------------------- @@ -1060,7 +1060,7 @@ SymbolFileDWARF::ParseCompileUnitLineTable (const SymbolContext &sc) const dw_offset_t cu_line_offset = dwarf_cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET); if (cu_line_offset != DW_INVALID_OFFSET) { - STD_UNIQUE_PTR(LineTable) line_table_ap(new LineTable(sc.comp_unit)); + std::unique_ptr<LineTable> line_table_ap(new LineTable(sc.comp_unit)); if (line_table_ap.get()) { ParseDWARFLineTableCallbackInfo info; @@ -1170,12 +1170,12 @@ SymbolFileDWARF::ParseFunctionBlocks if (tag != DW_TAG_subprogram && (name != NULL || mangled_name != NULL)) { - STD_UNIQUE_PTR(Declaration) decl_ap; + std::unique_ptr<Declaration> decl_ap; if (decl_file != 0 || decl_line != 0 || decl_column != 0) decl_ap.reset(new Declaration(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(decl_file), decl_line, decl_column)); - STD_UNIQUE_PTR(Declaration) call_ap; + std::unique_ptr<Declaration> call_ap; if (call_file != 0 || call_line != 0 || call_column != 0) call_ap.reset(new Declaration(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(call_file), call_line, call_column)); @@ -1435,7 +1435,7 @@ private: const char *m_property_setter_name; const char *m_property_getter_name; uint32_t m_property_attributes; - STD_UNIQUE_PTR(ClangASTMetadata) m_metadata_ap; + std::unique_ptr<ClangASTMetadata> m_metadata_ap; }; struct BitfieldInfo diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 4fd0ba00d13..08dfc9632ee 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -568,13 +568,13 @@ protected: // The unique pointer items below are generated on demand if and when someone accesses // them through a non const version of this class. - STD_UNIQUE_PTR(DWARFDebugAbbrev) m_abbr; - STD_UNIQUE_PTR(DWARFDebugInfo) m_info; - STD_UNIQUE_PTR(DWARFDebugLine) m_line; - STD_UNIQUE_PTR(DWARFMappedHash::MemoryTable) m_apple_names_ap; - STD_UNIQUE_PTR(DWARFMappedHash::MemoryTable) m_apple_types_ap; - STD_UNIQUE_PTR(DWARFMappedHash::MemoryTable) m_apple_namespaces_ap; - STD_UNIQUE_PTR(DWARFMappedHash::MemoryTable) m_apple_objc_ap; + std::unique_ptr<DWARFDebugAbbrev> m_abbr; + std::unique_ptr<DWARFDebugInfo> m_info; + std::unique_ptr<DWARFDebugLine> m_line; + std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_ap; + std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_ap; + std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_ap; + std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_ap; NameToDIE m_function_basename_index; // All concrete functions NameToDIE m_function_fullname_index; // All concrete functions NameToDIE m_function_method_index; // All inlined functions @@ -588,7 +588,7 @@ protected: m_using_apple_tables:1; lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; - STD_UNIQUE_PTR(DWARFDebugRanges) m_ranges; + std::unique_ptr<DWARFDebugRanges> m_ranges; UniqueDWARFASTTypeMap m_unique_ast_type_map; typedef llvm::SmallPtrSet<const DWARFDebugInfoEntry *, 4> DIEPointerSet; typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::DeclContext *> DIEToDeclContextMap; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 02d0c6205c8..aa21778222e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -142,7 +142,7 @@ protected: } }; - typedef STD_SHARED_PTR(OSOInfo) OSOInfoSP; + typedef std::shared_ptr<OSOInfo> OSOInfoSP; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, lldb::addr_t> FileRangeMap; diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index 0510b743039..d2301b617aa 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -298,7 +298,7 @@ UnwindAssemblyInstEmulation::FirstNonPrologueInsn (AddressRange& func, UnwindAssembly * UnwindAssemblyInstEmulation::CreateInstance (const ArchSpec &arch) { - STD_UNIQUE_PTR(EmulateInstruction) inst_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypePrologueEpilogue, NULL)); + std::unique_ptr<EmulateInstruction> inst_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypePrologueEpilogue, NULL)); // Make sure that all prologue instructions are handled if (inst_emulator_ap.get()) return new UnwindAssemblyInstEmulation (arch, inst_emulator_ap.release()); diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h index deff8b03228..653c75a5f0f 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -160,7 +160,7 @@ private: GetRegisterValue (const lldb_private::RegisterInfo ®_info, lldb_private::RegisterValue ®_value); - STD_UNIQUE_PTR(lldb_private::EmulateInstruction) m_inst_emulator_ap; + std::unique_ptr<lldb_private::EmulateInstruction> m_inst_emulator_ap; lldb_private::AddressRange* m_range_ptr; lldb_private::Thread* m_thread_ptr; lldb_private::UnwindPlan* m_unwind_plan_ptr; diff --git a/lldb/source/Symbol/LineTable.cpp b/lldb/source/Symbol/LineTable.cpp index 98f7e127ca3..a4aa35ddb31 100644 --- a/lldb/source/Symbol/LineTable.cpp +++ b/lldb/source/Symbol/LineTable.cpp @@ -489,7 +489,7 @@ LineTable::GetContiguousFileAddressRanges (FileAddressRanges &file_ranges, bool LineTable * LineTable::LinkLineTable (const FileRangeMap &file_range_map) { - STD_UNIQUE_PTR(LineTable) line_table_ap (new LineTable (m_comp_unit)); + std::unique_ptr<LineTable> line_table_ap (new LineTable (m_comp_unit)); LineSequenceImpl sequence; const size_t count = m_entries.size(); LineEntry line_entry; diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 78c64456231..c12cdd6517f 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -59,7 +59,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, { for (uint32_t idx = 0; (create_object_container_callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(ObjectContainer) object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); + std::unique_ptr<ObjectContainer> object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); if (object_container_ap.get()) object_file_sp = object_container_ap->GetObjectFile(file); @@ -101,7 +101,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, // (like BSD archives caching the contained objects within an file). for (uint32_t idx = 0; (create_object_container_callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(ObjectContainer) object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); + std::unique_ptr<ObjectContainer> object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); if (object_container_ap.get()) object_file_sp = object_container_ap->GetObjectFile(file); @@ -133,7 +133,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, // an object file from the container. for (uint32_t idx = 0; (create_object_container_callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(ObjectContainer) object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); + std::unique_ptr<ObjectContainer> object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); if (object_container_ap.get()) object_file_sp = object_container_ap->GetObjectFile(file); @@ -392,7 +392,7 @@ ObjectFile::ReadMemory (const ProcessSP &process_sp, lldb::addr_t addr, size_t b DataBufferSP data_sp; if (process_sp) { - STD_UNIQUE_PTR(DataBufferHeap) data_ap (new DataBufferHeap (byte_size, 0)); + std::unique_ptr<DataBufferHeap> data_ap (new DataBufferHeap (byte_size, 0)); Error error; const size_t bytes_read = process_sp->ReadMemory (addr, data_ap->GetBytes(), diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp index a3d2c0e0773..a59f6c93bac 100644 --- a/lldb/source/Symbol/SymbolFile.cpp +++ b/lldb/source/Symbol/SymbolFile.cpp @@ -21,7 +21,7 @@ using namespace lldb_private; SymbolFile* SymbolFile::FindPlugin (ObjectFile* obj_file) { - STD_UNIQUE_PTR(SymbolFile) best_symfile_ap; + std::unique_ptr<SymbolFile> best_symfile_ap; if (obj_file != NULL) { // TODO: Load any plug-ins in the appropriate plug-in search paths and @@ -32,7 +32,7 @@ SymbolFile::FindPlugin (ObjectFile* obj_file) SymbolFileCreateInstance create_callback; for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(SymbolFile) curr_symfile_ap(create_callback(obj_file)); + std::unique_ptr<SymbolFile> curr_symfile_ap(create_callback(obj_file)); if (curr_symfile_ap.get()) { diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index e3a2ca3ebf6..c991b1005b4 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -34,7 +34,7 @@ using namespace lldb_private; SymbolVendor* SymbolVendor::FindPlugin (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { - STD_UNIQUE_PTR(SymbolVendor) instance_ap; + std::unique_ptr<SymbolVendor> instance_ap; //---------------------------------------------------------------------- // We currently only have one debug symbol parser... //---------------------------------------------------------------------- diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp index d3d3fe1f0bd..d2f586ac82f 100644 --- a/lldb/source/Target/LanguageRuntime.cpp +++ b/lldb/source/Target/LanguageRuntime.cpp @@ -228,7 +228,7 @@ protected: LanguageRuntime* LanguageRuntime::FindPlugin (Process *process, lldb::LanguageType language) { - STD_UNIQUE_PTR(LanguageRuntime) language_runtime_ap; + std::unique_ptr<LanguageRuntime> language_runtime_ap; LanguageRuntimeCreateInstance create_callback; for (uint32_t idx = 0; diff --git a/lldb/source/Target/Memory.cpp b/lldb/source/Target/Memory.cpp index f9aaca1e356..ecefd2ef0e0 100644 --- a/lldb/source/Target/Memory.cpp +++ b/lldb/source/Target/Memory.cpp @@ -178,7 +178,7 @@ MemoryCache::Read (addr_t addr, if (bytes_left > 0) { assert ((curr_addr % cache_line_byte_size) == 0); - STD_UNIQUE_PTR(DataBufferHeap) data_buffer_heap_ap(new DataBufferHeap (cache_line_byte_size, 0)); + std::unique_ptr<DataBufferHeap> data_buffer_heap_ap(new DataBufferHeap (cache_line_byte_size, 0)); size_t process_bytes_read = m_process.ReadMemoryFromInferior (curr_addr, data_buffer_heap_ap->GetBytes(), data_buffer_heap_ap->GetByteSize(), diff --git a/lldb/source/Target/OperatingSystem.cpp b/lldb/source/Target/OperatingSystem.cpp index 54348856142..33ae584f336 100644 --- a/lldb/source/Target/OperatingSystem.cpp +++ b/lldb/source/Target/OperatingSystem.cpp @@ -28,7 +28,7 @@ OperatingSystem::FindPlugin (Process *process, const char *plugin_name) create_callback = PluginManager::GetOperatingSystemCreateCallbackForPluginName (plugin_name); if (create_callback) { - STD_UNIQUE_PTR(OperatingSystem) instance_ap(create_callback(process, true)); + std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, true)); if (instance_ap.get()) return instance_ap.release(); } @@ -37,7 +37,7 @@ OperatingSystem::FindPlugin (Process *process, const char *plugin_name) { for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(OperatingSystem) instance_ap(create_callback(process, false)); + std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, false)); if (instance_ap.get()) return instance_ap.release(); } diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index e58618e36d4..ed98fb26286 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -109,7 +109,7 @@ Platform::FindPlugin (Process *process, const char *plugin_name) { arch = process->GetTarget().GetArchitecture(); } - STD_UNIQUE_PTR(Platform) instance_ap(create_callback(process, &arch)); + std::unique_ptr<Platform> instance_ap(create_callback(process, &arch)); if (instance_ap.get()) return instance_ap.release(); } @@ -118,7 +118,7 @@ Platform::FindPlugin (Process *process, const char *plugin_name) { for (uint32_t idx = 0; (create_callback = PluginManager::GetPlatformCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(Platform) instance_ap(create_callback(process, false)); + std::unique_ptr<Platform> instance_ap(create_callback(process, false)); if (instance_ap.get()) return instance_ap.release(); } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 9ab9bc313f7..3fe92a32549 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4440,7 +4440,7 @@ Process::SetSTDIOFileDescriptor (int file_descriptor) { // First set up the Read Thread for reading/handling process I/O - STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap (new ConnectionFileDescriptor (file_descriptor, true)); + std::unique_ptr<ConnectionFileDescriptor> conn_ap (new ConnectionFileDescriptor (file_descriptor, true)); if (conn_ap.get()) { diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index 41f57658e63..ef798cbb13a 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -717,7 +717,7 @@ StackFrameList::InvalidateFrames (uint32_t start_idx) } void -StackFrameList::Merge (STD_UNIQUE_PTR(StackFrameList)& curr_ap, lldb::StackFrameListSP& prev_sp) +StackFrameList::Merge (std::unique_ptr<StackFrameList>& curr_ap, lldb::StackFrameListSP& prev_sp) { Mutex::Locker curr_locker (curr_ap.get() ? &curr_ap->m_mutex : NULL); Mutex::Locker prev_locker (prev_sp.get() ? &prev_sp->m_mutex : NULL); diff --git a/lldb/source/Target/UnwindAssembly.cpp b/lldb/source/Target/UnwindAssembly.cpp index 4901f6d91ae..72137501f38 100644 --- a/lldb/source/Target/UnwindAssembly.cpp +++ b/lldb/source/Target/UnwindAssembly.cpp @@ -24,7 +24,7 @@ UnwindAssembly::FindPlugin (const ArchSpec &arch) (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != NULL; ++idx) { - STD_UNIQUE_PTR(UnwindAssembly) assembly_profiler_ap (create_callback (arch)); + std::unique_ptr<UnwindAssembly> assembly_profiler_ap (create_callback (arch)); if (assembly_profiler_ap.get ()) return assembly_profiler_ap.release (); } diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp index fb780c8ca35..96e3da9c9d3 100644 --- a/lldb/tools/debugserver/source/DNB.cpp +++ b/lldb/tools/debugserver/source/DNB.cpp @@ -36,7 +36,7 @@ #include "CFBundle.h" -typedef STD_SHARED_PTR(MachProcess) MachProcessSP; +typedef std::shared_ptr<MachProcess> MachProcessSP; typedef std::map<nub_process_t, MachProcessSP> ProcessMap; typedef ProcessMap::iterator ProcessMapIter; typedef ProcessMap::const_iterator ProcessMapConstIter; diff --git a/lldb/tools/debugserver/source/DNB.h b/lldb/tools/debugserver/source/DNB.h index c6acf5bbf7d..cd5cd61542c 100644 --- a/lldb/tools/debugserver/source/DNB.h +++ b/lldb/tools/debugserver/source/DNB.h @@ -16,6 +16,7 @@ #include "DNBDefs.h" #include <mach/thread_info.h> +#include <string> #define DNB_EXPORT __attribute__((visibility("default"))) diff --git a/lldb/tools/debugserver/source/DNBDefs.h b/lldb/tools/debugserver/source/DNBDefs.h index 98b7310ca5a..1b8d11f595b 100644 --- a/lldb/tools/debugserver/source/DNBDefs.h +++ b/lldb/tools/debugserver/source/DNBDefs.h @@ -20,22 +20,6 @@ #include <sys/syslimits.h> #include <unistd.h> -#include <ciso646> // detect C++ lib - -#ifdef _LIBCPP_VERSION -#include <memory> -#define STD_SHARED_PTR(T) std::shared_ptr<T> -#define STD_WEAK_PTR(T) std::weak_ptr<T> -#define STD_UNIQUE_PTR(T) std::unique_ptr<T> -#define STD_ENABLE_SHARED_FROM_THIS(T) std::enable_shared_from_this<T> -#else -#include <tr1/memory> -#define STD_SHARED_PTR(T) std::tr1::shared_ptr<T> -#define STD_WEAK_PTR(T) std::tr1::weak_ptr<T> -#define STD_UNIQUE_PTR(T) std::auto_ptr<T> -#define STD_ENABLE_SHARED_FROM_THIS(T) std::tr1::enable_shared_from_this<T> -#endif - //---------------------------------------------------------------------- // Define nub_addr_t and the invalid address value from the architecture //---------------------------------------------------------------------- diff --git a/lldb/tools/debugserver/source/DNBTimer.h b/lldb/tools/debugserver/source/DNBTimer.h index ac69d9a36a1..717e1563be5 100644 --- a/lldb/tools/debugserver/source/DNBTimer.h +++ b/lldb/tools/debugserver/source/DNBTimer.h @@ -16,6 +16,7 @@ #include <sys/time.h> #include <stdint.h> +#include <memory> #include "DNBDefs.h" #include "PThreadMutex.h" @@ -155,7 +156,7 @@ protected: //------------------------------------------------------------------ // Classes that inherit from DNBTimer can see and modify these //------------------------------------------------------------------ - STD_UNIQUE_PTR(PThreadMutex) m_mutexAP; + std::unique_ptr<PThreadMutex> m_mutexAP; struct timeval m_timeval; }; diff --git a/lldb/tools/debugserver/source/MacOSX/MachThread.h b/lldb/tools/debugserver/source/MacOSX/MachThread.h index 27573c5c8ec..c6d7b312769 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachThread.h +++ b/lldb/tools/debugserver/source/MacOSX/MachThread.h @@ -130,7 +130,7 @@ protected: int32_t m_suspend_count; // The current suspend count > 0 means we have suspended m_suspendCount times, // < 0 means we have resumed it m_suspendCount times. MachException::Data m_stop_exception; // The best exception that describes why this thread is stopped - STD_UNIQUE_PTR(DNBArchProtocol) m_arch_ap; // Arch specific information for register state and more + std::unique_ptr<DNBArchProtocol> m_arch_ap; // Arch specific information for register state and more const DNBRegisterSetInfo * m_reg_sets; // Register set information for this thread nub_size_t m_num_reg_sets; thread_identifier_info_data_t m_ident_info; @@ -142,6 +142,6 @@ private: void HardwareWatchpointStateChanged(); // Provide a chance to update the global view of the hardware watchpoint state }; -typedef STD_SHARED_PTR(MachThread) MachThreadSP; +typedef std::shared_ptr<MachThread> MachThreadSP; #endif diff --git a/lldb/tools/debugserver/source/RNBDefs.h b/lldb/tools/debugserver/source/RNBDefs.h index bb4f06d33b0..9b9379ecc4f 100644 --- a/lldb/tools/debugserver/source/RNBDefs.h +++ b/lldb/tools/debugserver/source/RNBDefs.h @@ -15,6 +15,7 @@ #define __RNBDefs_h__ #include "DNBDefs.h" +#include <memory> extern "C" const unsigned char debugserverVersionString[]; extern "C" const double debugserverVersionNumber; @@ -49,7 +50,7 @@ extern "C" const double debugserverVersionNumber; #endif class RNBRemote; -typedef STD_SHARED_PTR(RNBRemote) RNBRemoteSP; +typedef std::shared_ptr<RNBRemote> RNBRemoteSP; typedef enum { diff --git a/lldb/tools/driver/Driver.h b/lldb/tools/driver/Driver.h index cb69edcae1f..fdbe18efc9f 100644 --- a/lldb/tools/driver/Driver.h +++ b/lldb/tools/driver/Driver.h @@ -160,7 +160,7 @@ private: lldb_utility::PseudoTerminal m_editline_pty; FILE *m_editline_slave_fh; lldb::SBInputReader m_editline_reader; - STD_UNIQUE_PTR(IOChannel) m_io_channel_ap; + std::unique_ptr<IOChannel> m_io_channel_ap; OptionData m_option_data; bool m_waiting_for_command; bool m_done; diff --git a/lldb/tools/lldb-perf/lib/Gauge.cpp b/lldb/tools/lldb-perf/lib/Gauge.cpp index 6ed12905e1b..4c4593b3b29 100644 --- a/lldb/tools/lldb-perf/lib/Gauge.cpp +++ b/lldb/tools/lldb-perf/lib/Gauge.cpp @@ -16,7 +16,7 @@ lldb_perf::GetResult (const char *description, double value) { if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddDouble("value", NULL, value); return Results::ResultSP (value_dict_ap.release()); @@ -30,7 +30,7 @@ lldb_perf::GetResult (const char *description, uint64_t value) { if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddUnsigned("value", NULL, value); return Results::ResultSP (value_dict_ap.release()); @@ -44,7 +44,7 @@ lldb_perf::GetResult (const char *description, std::string value) { if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddString("value", NULL, value.c_str()); return Results::ResultSP (value_dict_ap.release()); diff --git a/lldb/tools/lldb-perf/lib/MemoryGauge.cpp b/lldb/tools/lldb-perf/lib/MemoryGauge.cpp index de6c820928b..2a46453f540 100644 --- a/lldb/tools/lldb-perf/lib/MemoryGauge.cpp +++ b/lldb/tools/lldb-perf/lib/MemoryGauge.cpp @@ -92,7 +92,7 @@ MemoryStats::operator * (const MemoryStats& rhs) Results::ResultSP MemoryStats::GetResult (const char *name, const char *description) const { - STD_UNIQUE_PTR(Results::Dictionary) dict_ap (new Results::Dictionary (name, NULL)); + std::unique_ptr<Results::Dictionary> dict_ap (new Results::Dictionary (name, NULL)); dict_ap->AddUnsigned("resident", NULL, GetResidentSize()); dict_ap->AddUnsigned("max_resident", NULL, GetMaxResidentSize()); return Results::ResultSP(dict_ap.release()); diff --git a/lldb/tools/lldb-perf/lib/Results.cpp b/lldb/tools/lldb-perf/lib/Results.cpp index d5e92bf113c..6abf67e53b6 100644 --- a/lldb/tools/lldb-perf/lib/Results.cpp +++ b/lldb/tools/lldb-perf/lib/Results.cpp @@ -182,7 +182,7 @@ Results::Dictionary::AddUnsigned (const char *name, const char *description, uin assert (name && name[0]); if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddUnsigned("value", NULL, value); m_dictionary[std::string(name)] = ResultSP (value_dict_ap.release()); @@ -199,7 +199,7 @@ Results::Dictionary::AddDouble (const char *name, const char *description, doubl if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddDouble("value", NULL, value); m_dictionary[std::string(name)] = ResultSP (value_dict_ap.release()); @@ -214,7 +214,7 @@ Results::Dictionary::AddString (const char *name, const char *description, const assert (name && name[0]); if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->AddString("value", NULL, value); m_dictionary[std::string(name)] = ResultSP (value_dict_ap.release()); @@ -230,7 +230,7 @@ Results::Dictionary::Add (const char *name, const char *description, const Resul assert (name && name[0]); if (description && description[0]) { - STD_UNIQUE_PTR(Results::Dictionary) value_dict_ap (new Results::Dictionary ()); + std::unique_ptr<Results::Dictionary> value_dict_ap (new Results::Dictionary ()); value_dict_ap->AddString("description", NULL, description); value_dict_ap->Add("value", NULL, result_sp); m_dictionary[std::string(name)] = ResultSP (value_dict_ap.release()); diff --git a/lldb/tools/lldb-perf/lib/Results.h b/lldb/tools/lldb-perf/lib/Results.h index 41501758dae..388077e7f58 100644 --- a/lldb/tools/lldb-perf/lib/Results.h +++ b/lldb/tools/lldb-perf/lib/Results.h @@ -123,7 +123,7 @@ public: Type m_type; }; - typedef STD_SHARED_PTR(Result) ResultSP; + typedef std::shared_ptr<Result> ResultSP; class Array : public Result { diff --git a/lldb/tools/lldb-platform/lldb-platform.cpp b/lldb/tools/lldb-platform/lldb-platform.cpp index 9d8a7167b6c..112dc9ed04c 100644 --- a/lldb/tools/lldb-platform/lldb-platform.cpp +++ b/lldb/tools/lldb-platform/lldb-platform.cpp @@ -185,7 +185,7 @@ main (int argc, char *argv[]) GDBRemoteCommunicationServer gdb_server (true); if (!listen_host_port.empty()) { - STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap(new ConnectionFileDescriptor()); + std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor()); if (conn_ap.get()) { std::string connect_url ("listen://"); |

