summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/Args.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2016-08-19 03:03:58 +0000
committerTodd Fiala <todd.fiala@gmail.com>2016-08-19 03:03:58 +0000
commita07e4a8352562f0d63191ed76a152166e14bb268 (patch)
tree63b8691ddfcad1a9569002b503a830dd78a763e8 /lldb/source/Interpreter/Args.cpp
parentfdc4c6b426aa6492ce3ed175fc6180aec5964fce (diff)
downloadbcm5719-llvm-a07e4a8352562f0d63191ed76a152166e14bb268.tar.gz
bcm5719-llvm-a07e4a8352562f0d63191ed76a152166e14bb268.zip
Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
Diffstat (limited to 'lldb/source/Interpreter/Args.cpp')
-rw-r--r--lldb/source/Interpreter/Args.cpp46
1 files changed, 1 insertions, 45 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 8ddc91bb109..3e5b55a482a 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -1170,48 +1170,8 @@ Args::LongestCommonPrefix (std::string &common_prefix)
}
}
-void
-Args::AddOrReplaceEnvironmentVariable(const char *env_var_name,
- const char *new_value)
-{
- if (!env_var_name || !new_value)
- return;
-
- // Build the new entry.
- StreamString stream;
- stream << env_var_name;
- stream << '=';
- stream << new_value;
- stream.Flush();
-
- // Find the environment variable if present and replace it.
- for (size_t i = 0; i < GetArgumentCount(); ++i)
- {
- // Get the env var value.
- const char *arg_value = GetArgumentAtIndex(i);
- if (!arg_value)
- continue;
-
- // Find the name of the env var: before the first =.
- auto equal_p = strchr(arg_value, '=');
- if (!equal_p)
- continue;
-
- // Check if the name matches the given env_var_name.
- if (strncmp(env_var_name, arg_value, equal_p - arg_value) == 0)
- {
- ReplaceArgumentAtIndex(i, stream.GetString().c_str());
- return;
- }
- }
-
- // We didn't find it. Append it instead.
- AppendArgument(stream.GetString().c_str());
-}
-
bool
-Args::ContainsEnvironmentVariable(const char *env_var_name,
- size_t *argument_index) const
+Args::ContainsEnvironmentVariable(const char *env_var_name) const
{
// Validate args.
if (!env_var_name)
@@ -1233,8 +1193,6 @@ Args::ContainsEnvironmentVariable(const char *env_var_name,
equal_p - argument_value) == 0)
{
// We matched.
- if (argument_index)
- *argument_index = i;
return true;
}
}
@@ -1244,8 +1202,6 @@ Args::ContainsEnvironmentVariable(const char *env_var_name,
if (strcmp(argument_value, env_var_name) == 0)
{
// We matched.
- if (argument_index)
- *argument_index = i;
return true;
}
}
OpenPOWER on IntegriCloud