diff options
author | Greg Clayton <gclayton@apple.com> | 2011-09-12 04:00:42 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-09-12 04:00:42 +0000 |
commit | 6372d1cda2c6b180bdf926c10d423b682ad2453c (patch) | |
tree | 6beae9767fbb7cc3245f84fe01dfe2a305f6d5eb /lldb/source/Host/common/FileSpec.cpp | |
parent | 24756648e55fefee7024d12abd26a64a66963e81 (diff) | |
download | bcm5719-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.cpp | 5 |
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; } //---------------------------------------------------------------------- |