summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-09-19 17:54:06 +0000
committerZachary Turner <zturner@google.com>2016-09-19 17:54:06 +0000
commitecbb0bb1690cd59da0224d7b906f968356b1265c (patch)
tree90951f44a7abb40b355e849a2e64cb09ec3ac900 /lldb/source/Host/linux
parent495b211a6c775e6fbc00a1e3a91786f6a880b82e (diff)
downloadbcm5719-llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.tar.gz
bcm5719-llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.zip
Fix more functions in Args to use StringRef.
This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
Diffstat (limited to 'lldb/source/Host/linux')
-rw-r--r--lldb/source/Host/linux/Host.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index ca2084d62e5..8acf4a94e5b 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -323,7 +323,7 @@ static bool GetProcessAndStatInfo(lldb::pid_t pid,
char *next_var = (char *)buf_sp->GetBytes();
char *end_buf = next_var + buf_sp->GetByteSize();
while (next_var < end_buf && 0 != *next_var) {
- info_env.AppendArgument(next_var);
+ info_env.AppendArgument(llvm::StringRef(next_var));
next_var += strlen(next_var) + 1;
}
@@ -340,7 +340,7 @@ static bool GetProcessAndStatInfo(lldb::pid_t pid,
char *next_arg = cmd + strlen(cmd) + 1;
end_buf = cmd + buf_sp->GetByteSize();
while (next_arg < end_buf && 0 != *next_arg) {
- info_args.AppendArgument(next_arg);
+ info_args.AppendArgument(llvm::StringRef(next_arg));
next_arg += strlen(next_arg) + 1;
}
}
OpenPOWER on IntegriCloud