diff options
| author | Zachary Turner <zturner@google.com> | 2016-11-17 18:08:12 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-11-17 18:08:12 +0000 |
| commit | 31d97a5c8ab78c619deada0cdb1fcf64021d25dd (patch) | |
| tree | a1f642a22b8975a80013c7ab8bc98a7ea763346e /lldb/source/Target/ProcessInfo.cpp | |
| parent | ff0382c16190cd2b1bc47b27c5db0570b90f1d39 (diff) | |
| download | llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.tar.gz llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.tar.bz2 llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.zip | |
Rewrite all Property related functions in terms of StringRef.
This was a bit tricky, especially for things like
OptionValueArray and OptionValueDictionary since they do some
funky string parsing. Rather than try to re-write line-by-line
I tried to make the StringRef usage idiomatic, even though
it meant often re-writing from scratch large blocks of code
in a different way while keeping true to the original intent.
The finished code is a big improvement though, and often much
shorter than the original code. All tests and unit tests
pass on Windows and Linux.
llvm-svn: 287242
Diffstat (limited to 'lldb/source/Target/ProcessInfo.cpp')
| -rw-r--r-- | lldb/source/Target/ProcessInfo.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Target/ProcessInfo.cpp b/lldb/source/Target/ProcessInfo.cpp index 4b02332f4d9f..5c4b2f07e426 100644 --- a/lldb/source/Target/ProcessInfo.cpp +++ b/lldb/source/Target/ProcessInfo.cpp @@ -78,15 +78,12 @@ void ProcessInfo::SetExecutableFile(const FileSpec &exe_file, } } -const char *ProcessInfo::GetArg0() const { - return (m_arg0.empty() ? nullptr : m_arg0.c_str()); +llvm::StringRef ProcessInfo::GetArg0() const { + return m_arg0; } -void ProcessInfo::SetArg0(const char *arg) { - if (arg && arg[0]) - m_arg0 = arg; - else - m_arg0.clear(); +void ProcessInfo::SetArg0(llvm::StringRef arg) { + m_arg0 = arg; } void ProcessInfo::SetArguments(char const **argv, |
