summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-04-29 16:36:27 +0000
committerGreg Clayton <gclayton@apple.com>2013-04-29 16:36:27 +0000
commita44c1e6b63930c2e380d4c1f09ac47984ad67775 (patch)
treeeda2843ad35788ff272133f6dcc99ba8b09ad9f7 /lldb/source/Host/common/FileSpec.cpp
parentd56a262200aa36ba118a305a5ecc1a2ec5986ca1 (diff)
downloadbcm5719-llvm-a44c1e6b63930c2e380d4c1f09ac47984ad67775.tar.gz
bcm5719-llvm-a44c1e6b63930c2e380d4c1f09ac47984ad67775.zip
Don't return a reference to a local variable, and removed a redundant API.
llvm-svn: 180713
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index 4764169a618..8405c0a9f2b 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -702,12 +702,12 @@ FileSpec::GetPath(char *path, size_t path_max_len) const
return 0;
}
-void
-FileSpec::GetPath (std::string &path) const
+std::string
+FileSpec::GetPath (void) const
{
+ std::string path;
const char *dirname = m_directory.GetCString();
const char *filename = m_filename.GetCString();
- path.clear();
if (dirname)
{
path.append (dirname);
@@ -715,17 +715,7 @@ FileSpec::GetPath (std::string &path) const
path.append ("/");
}
if (filename)
- {
path.append (filename);
- }
-}
-
-
-std::string&
-FileSpec::GetPath (void) const
-{
- std::string path;
- GetPath (path);
return path;
}
OpenPOWER on IntegriCloud