summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-09-12 04:00:42 +0000
committerGreg Clayton <gclayton@apple.com>2011-09-12 04:00:42 +0000
commit6372d1cda2c6b180bdf926c10d423b682ad2453c (patch)
tree6beae9767fbb7cc3245f84fe01dfe2a305f6d5eb /lldb/source/Host/common/FileSpec.cpp
parent24756648e55fefee7024d12abd26a64a66963e81 (diff)
downloadbcm5719-llvm-6372d1cda2c6b180bdf926c10d423b682ad2453c.tar.gz
bcm5719-llvm-6372d1cda2c6b180bdf926c10d423b682ad2453c.zip
Changed to using an "operator bool" instead of an "operator void*"
and avoid returning a pointer to the current object. In the new "operator bool" implementation, check the filename object first since many times we have FileSpec objects with a filename, yet no directory. llvm-svn: 139488
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index ba9f9201fc4..8f398e05ada 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -352,10 +352,9 @@ FileSpec::SetFile (const char *pathname, bool resolve)
// if (file_spec)
// {}
//----------------------------------------------------------------------
-FileSpec::operator
-void*() const
+FileSpec::operator bool() const
{
- return (m_directory || m_filename) ? const_cast<FileSpec*>(this) : NULL;
+ return m_filename || m_directory;
}
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud