diff options
Diffstat (limited to 'lldb/source/Host/macosx')
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCBundle.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCBundle.h | 2 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCData.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCData.h | 4 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableArray.h | 2 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCMutableSet.h | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCReleaser.h | 18 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCString.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CFCString.h | 2 | ||||
-rw-r--r-- | lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h | 2 |
14 files changed, 0 insertions, 92 deletions
diff --git a/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp b/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp index 06057b5ed46..0ca2c00798f 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp @@ -9,9 +9,7 @@ #include "CFCBundle.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCBundle constructor -//---------------------------------------------------------------------- CFCBundle::CFCBundle(const char *path) : CFCReleaser<CFBundleRef>() { if (path && path[0]) SetPath(path); @@ -20,14 +18,10 @@ CFCBundle::CFCBundle(const char *path) : CFCReleaser<CFBundleRef>() { CFCBundle::CFCBundle(CFURLRef url) : CFCReleaser<CFBundleRef>(url ? CFBundleCreate(NULL, url) : NULL) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCBundle::~CFCBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFCBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and URL diff --git a/lldb/source/Host/macosx/cfcpp/CFCBundle.h b/lldb/source/Host/macosx/cfcpp/CFCBundle.h index 12516048f47..9ff58fba854 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCBundle.h +++ b/lldb/source/Host/macosx/cfcpp/CFCBundle.h @@ -13,9 +13,7 @@ class CFCBundle : public CFCReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCBundle(const char *path = NULL); CFCBundle(CFURLRef url); diff --git a/lldb/source/Host/macosx/cfcpp/CFCData.cpp b/lldb/source/Host/macosx/cfcpp/CFCData.cpp index c3deeca2ce9..191f4734c64 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCData.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCData.cpp @@ -8,19 +8,13 @@ #include "CFCData.h" -//---------------------------------------------------------------------- // CFCData constructor -//---------------------------------------------------------------------- CFCData::CFCData(CFDataRef data) : CFCReleaser<CFDataRef>(data) {} -//---------------------------------------------------------------------- // CFCData copy constructor -//---------------------------------------------------------------------- CFCData::CFCData(const CFCData &rhs) : CFCReleaser<CFDataRef>(rhs) {} -//---------------------------------------------------------------------- // CFCData copy constructor -//---------------------------------------------------------------------- CFCData &CFCData::operator=(const CFCData &rhs) { @@ -29,9 +23,7 @@ CFCData &CFCData::operator=(const CFCData &rhs) return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCData::~CFCData() {} CFIndex CFCData::GetLength() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCData.h b/lldb/source/Host/macosx/cfcpp/CFCData.h index b0b25232b1c..33fcf53ed0b 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCData.h +++ b/lldb/source/Host/macosx/cfcpp/CFCData.h @@ -13,9 +13,7 @@ class CFCData : public CFCReleaser<CFDataRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCData(CFDataRef data = NULL); CFCData(const CFCData &rhs); CFCData &operator=(const CFCData &rhs); @@ -26,9 +24,7 @@ public: CFIndex GetLength() const; protected: - //------------------------------------------------------------------ // Classes that inherit from CFCData can see and modify these - //------------------------------------------------------------------ }; #endif // #ifndef CoreFoundationCPP_CFData_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp index 75bc12d28ff..a2172c296f6 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp @@ -9,24 +9,18 @@ #include "CFCMutableArray.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableArray::CFCMutableArray(CFMutableArrayRef s) : CFCReleaser<CFMutableArrayRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableArray copy constructor -//---------------------------------------------------------------------- CFCMutableArray::CFCMutableArray(const CFCMutableArray &rhs) : CFCReleaser<CFMutableArrayRef>(rhs) // NOTE: this won't make a copy of the // array, just add a new reference to // it {} -//---------------------------------------------------------------------- // CFCMutableArray copy constructor -//---------------------------------------------------------------------- CFCMutableArray &CFCMutableArray::operator=(const CFCMutableArray &rhs) { if (this != &rhs) *this = rhs; // NOTE: this operator won't make a copy of the array, just add @@ -34,9 +28,7 @@ CFCMutableArray &CFCMutableArray::operator=(const CFCMutableArray &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableArray::~CFCMutableArray() {} CFIndex CFCMutableArray::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h index ba12301d1fd..46c5b912627 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h @@ -13,9 +13,7 @@ class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableArray(CFMutableArrayRef array = NULL); CFCMutableArray(const CFCMutableArray &rhs); // This will copy the array // contents into a new array diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp index 93094161382..66d572d2cfc 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp @@ -8,21 +8,15 @@ #include "CFCMutableDictionary.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableDictionary::CFCMutableDictionary(CFMutableDictionaryRef s) : CFCReleaser<CFMutableDictionaryRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableDictionary copy constructor -//---------------------------------------------------------------------- CFCMutableDictionary::CFCMutableDictionary(const CFCMutableDictionary &rhs) : CFCReleaser<CFMutableDictionaryRef>(rhs) {} -//---------------------------------------------------------------------- // CFCMutableDictionary copy constructor -//---------------------------------------------------------------------- const CFCMutableDictionary &CFCMutableDictionary:: operator=(const CFCMutableDictionary &rhs) { if (this != &rhs) @@ -30,9 +24,7 @@ operator=(const CFCMutableDictionary &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableDictionary::~CFCMutableDictionary() {} CFIndex CFCMutableDictionary::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h index 99849f4dd01..e9b494a5854 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h @@ -13,16 +13,12 @@ class CFCMutableDictionary : public CFCReleaser<CFMutableDictionaryRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableDictionary(CFMutableDictionaryRef s = NULL); CFCMutableDictionary(const CFCMutableDictionary &rhs); virtual ~CFCMutableDictionary(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const CFCMutableDictionary &operator=(const CFCMutableDictionary &rhs); CFIndex GetCount() const; @@ -61,14 +57,10 @@ public: CFMutableDictionaryRef Dictionary(bool can_create); protected: - //------------------------------------------------------------------ // Classes that inherit from CFCMutableDictionary can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For CFCMutableDictionary only - //------------------------------------------------------------------ }; #endif // CoreFoundationCPP_CFMutableDictionary_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp index bcfa7ce291d..a6517fafb00 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp @@ -9,30 +9,22 @@ #include "CFCMutableSet.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableSet::CFCMutableSet(CFMutableSetRef s) : CFCReleaser<CFMutableSetRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableSet copy constructor -//---------------------------------------------------------------------- CFCMutableSet::CFCMutableSet(const CFCMutableSet &rhs) : CFCReleaser<CFMutableSetRef>(rhs) {} -//---------------------------------------------------------------------- // CFCMutableSet copy constructor -//---------------------------------------------------------------------- const CFCMutableSet &CFCMutableSet::operator=(const CFCMutableSet &rhs) { if (this != &rhs) *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableSet::~CFCMutableSet() {} CFIndex CFCMutableSet::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h index 5aabaffe664..a55d646be6e 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h @@ -13,16 +13,12 @@ class CFCMutableSet : public CFCReleaser<CFMutableSetRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableSet(CFMutableSetRef s = NULL); CFCMutableSet(const CFCMutableSet &rhs); virtual ~CFCMutableSet(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const CFCMutableSet &operator=(const CFCMutableSet &rhs); CFIndex GetCount() const; @@ -33,14 +29,10 @@ public: void RemoveAllValues(); protected: - //------------------------------------------------------------------ // Classes that inherit from CFCMutableSet can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For CFCMutableSet only - //------------------------------------------------------------------ }; #endif // CoreFoundationCPP_CFMutableSet_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCReleaser.h b/lldb/source/Host/macosx/cfcpp/CFCReleaser.h index 816dba8813b..8a29f398021 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCReleaser.h +++ b/lldb/source/Host/macosx/cfcpp/CFCReleaser.h @@ -15,7 +15,6 @@ #include <assert.h> -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. This class @@ -24,42 +23,33 @@ // CFCReleaser<T>::release() function won't actually CFRelease any owned // pointer, it is designed to relinquish ownership of the pointer just // like std:auto_ptr<T>::release() does. -//---------------------------------------------------------------------- template <class T> class CFCReleaser { public: - //---------------------------------------------------------- // Constructor that takes a pointer to a CF object that is // to be released when this object goes out of scope - //---------------------------------------------------------- CFCReleaser(T ptr = NULL) : _ptr(ptr) {} - //---------------------------------------------------------- // Copy constructor // // Note that copying a CFCReleaser will not transfer // ownership of the contained pointer, but it will bump its // reference count. This is where this class differs from // std::auto_ptr. - //---------------------------------------------------------- CFCReleaser(const CFCReleaser &rhs) : _ptr(rhs.get()) { if (get()) ::CFRetain(get()); } - //---------------------------------------------------------- // The destructor will release the pointer that it contains // if it has a valid pointer. - //---------------------------------------------------------- virtual ~CFCReleaser() { reset(); } - //---------------------------------------------------------- // Assignment operator. // // Note that assigning one CFCReleaser to another will // not transfer ownership of the contained pointer, but it // will bump its reference count. This is where this class // differs from std::auto_ptr. - //---------------------------------------------------------- CFCReleaser &operator=(const CFCReleaser<T> &rhs) { if (this != &rhs) { // Replace our owned pointer with the new one @@ -71,7 +61,6 @@ public: return *this; } - //---------------------------------------------------------- // Get the address of the contained type in case it needs // to be passed to a function that will fill in a pointer // value. The function currently will assert if _ptr is not @@ -83,36 +72,29 @@ public: // sure any owned objects has CFRelease called on it. // I had to add the "enforce_null" bool here because some // API's require the pointer address even though they don't change it. - //---------------------------------------------------------- T *ptr_address(bool enforce_null = true) { if (enforce_null) assert(_ptr == NULL); return &_ptr; } - //---------------------------------------------------------- // Access the pointer itself - //---------------------------------------------------------- T get() { return _ptr; } const T get() const { return _ptr; } - //---------------------------------------------------------- // Set a new value for the pointer and CFRelease our old // value if we had a valid one. - //---------------------------------------------------------- void reset(T ptr = NULL) { if ((_ptr != NULL) && (ptr != _ptr)) ::CFRelease(_ptr); _ptr = ptr; } - //---------------------------------------------------------- // Release ownership without calling CFRelease. This class // is designed to mimic std::auto_ptr<T>, so the release // method releases ownership of the contained pointer // and does NOT call CFRelease. - //---------------------------------------------------------- T release() { T tmp = _ptr; _ptr = NULL; diff --git a/lldb/source/Host/macosx/cfcpp/CFCString.cpp b/lldb/source/Host/macosx/cfcpp/CFCString.cpp index a0768755f11..fbd33fc7224 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCString.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCString.cpp @@ -10,19 +10,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCString::CFCString(CFStringRef s) : CFCReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFCString copy constructor -//---------------------------------------------------------------------- CFCString::CFCString(const CFCString &rhs) : CFCReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFCString copy constructor -//---------------------------------------------------------------------- CFCString &CFCString::operator=(const CFCString &rhs) { if (this != &rhs) *this = rhs; @@ -37,9 +31,7 @@ CFCString::CFCString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCString::~CFCString() {} const char *CFCString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/source/Host/macosx/cfcpp/CFCString.h b/lldb/source/Host/macosx/cfcpp/CFCString.h index 2ed860fa20f..300b1c4a413 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCString.h +++ b/lldb/source/Host/macosx/cfcpp/CFCString.h @@ -15,9 +15,7 @@ class CFCString : public CFCReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCString(CFStringRef cf_str = NULL); CFCString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFCString(const CFCString &rhs); diff --git a/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h b/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h index 5a2e3996f10..0c2b82a34a3 100644 --- a/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h +++ b/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h @@ -5,7 +5,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -//---------------------------------------------------------------------- // // CoreFoundationCPP.h // CoreFoundationCPP @@ -13,7 +12,6 @@ // Created by Greg Clayton on 4/23/09. // // -//---------------------------------------------------------------------- #ifndef CoreFoundationCPP_CoreFoundationCPP_H_ #define CoreFoundationCPP_CoreFoundationCPP_H_ |