summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBFileSpec.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-08-07 17:33:36 +0000
committerZachary Turner <zturner@google.com>2014-08-07 17:33:36 +0000
commit3f55974024d9178825e73bdd0e97f19fba67a2b7 (patch)
treeb0d8adcd58ae949813c71eda11fb3e757c57390c /lldb/source/API/SBFileSpec.cpp
parentdf62f20c75d0984aac06b8b998988eb91262e43c (diff)
downloadbcm5719-llvm-3f55974024d9178825e73bdd0e97f19fba67a2b7.tar.gz
bcm5719-llvm-3f55974024d9178825e73bdd0e97f19fba67a2b7.zip
Optimizations for FileSpec.
llvm-svn: 215124
Diffstat (limited to 'lldb/source/API/SBFileSpec.cpp')
-rw-r--r--lldb/source/API/SBFileSpec.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 0de1c245846..8d63fc587d8 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -16,6 +16,8 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/Stream.h"
+#include "llvm/ADT/SmallString.h"
+
using namespace lldb;
using namespace lldb_private;
@@ -89,7 +91,11 @@ SBFileSpec::ResolveExecutableLocation ()
int
SBFileSpec::ResolvePath (const char *src_path, char *dst_path, size_t dst_len)
{
- return lldb_private::FileSpec::Resolve (src_path, dst_path, dst_len);
+ llvm::SmallString<64> result(src_path);
+ lldb_private::FileSpec::Resolve (result);
+ size_t result_length = std::min(dst_len-1, result.size());
+ ::strncpy(dst_path, result.c_str(), result_length + 1);
+ return result_length;
}
const char *
OpenPOWER on IntegriCloud