summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-10-10 01:11:39 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-10-10 01:11:39 +0000
commit2c77a427ab7a1c33962a6c190facae33aa499b81 (patch)
tree8c86966d551220970fc2d03851869385b5740905
parentb8e7eaedcb7152046237cc80b76d181d59e22234 (diff)
downloadbcm5719-llvm-2c77a427ab7a1c33962a6c190facae33aa499b81.tar.gz
bcm5719-llvm-2c77a427ab7a1c33962a6c190facae33aa499b81.zip
Reverse out r219169 related to quote handling.
Addresses pr/21190 (http://llvm.org/bugs/show_bug.cgi?id=21190). r219169 implemented this change list: http://reviews.llvm.org/D5472 for more details. llvm-svn: 219461
-rw-r--r--lldb/include/lldb/Expression/ClangExpressionParser.h1
-rw-r--r--lldb/include/lldb/Target/Target.h6
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp6
-rw-r--r--lldb/source/Expression/ClangFunction.cpp4
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp4
-rw-r--r--lldb/source/Expression/ClangUtilityFunction.cpp4
-rw-r--r--lldb/source/Interpreter/Args.cpp44
-rw-r--r--lldb/source/Target/Target.cpp16
8 files changed, 4 insertions, 81 deletions
diff --git a/lldb/include/lldb/Expression/ClangExpressionParser.h b/lldb/include/lldb/Expression/ClangExpressionParser.h
index 71c7e03762e..c79494d1a52 100644
--- a/lldb/include/lldb/Expression/ClangExpressionParser.h
+++ b/lldb/include/lldb/Expression/ClangExpressionParser.h
@@ -52,7 +52,6 @@ public:
//------------------------------------------------------------------
ClangExpressionParser (ExecutionContextScope *exe_scope,
ClangExpression &expr,
- Args &expr_parser_compiler_args,
bool generate_debug_info);
//------------------------------------------------------------------
diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h
index 79037d64f0a..64f3edf0fc4 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -113,12 +113,6 @@ public:
void
SetRunArguments (const Args &args);
-
- bool
- GetExprParserCompilerArguments (Args &args) const;
-
- void
- SetExprParserCompilerArguments (const Args &args);
size_t
GetEnvironmentAsArgs (Args &env) const;
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index 6d5796519ab..f32ca3ae216 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -98,7 +98,6 @@ std::string GetBuiltinIncludePath(const char *Argv0) {
ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
ClangExpression &expr,
- Args &expr_parser_compiler_args,
bool generate_debug_info) :
m_expr (expr),
m_compiler (),
@@ -153,11 +152,6 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
// 3. Set options.
- clang::CompilerInvocation::CreateFromArgs(m_compiler->getInvocation(),
- expr_parser_compiler_args.GetConstArgumentVector(),
- expr_parser_compiler_args.GetConstArgumentVector() + expr_parser_compiler_args.GetArgumentCount(),
- m_compiler->getDiagnostics());
-
lldb::LanguageType language = expr.Language();
switch (language)
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index aa860182653..5654e654cdb 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -238,9 +238,7 @@ ClangFunction::CompileFunction (Stream &errors)
if (jit_process_sp)
{
const bool generate_debug_info = true;
- Args expr_parser_compiler_args;
- jit_process_sp->GetTarget().GetExprParserCompilerArguments (expr_parser_compiler_args);
- m_parser.reset(new ClangExpressionParser(jit_process_sp.get(), *this, expr_parser_compiler_args, generate_debug_info));
+ m_parser.reset(new ClangExpressionParser(jit_process_sp.get(), *this, generate_debug_info));
num_errors = m_parser->Parse (errors);
}
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 47d80f8c2ca..dab7b556e39 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -527,9 +527,7 @@ ClangUserExpression::Parse (Stream &error_stream,
if (!exe_scope)
exe_scope = exe_ctx.GetTargetPtr();
- Args expr_parser_compiler_args;
- target->GetExprParserCompilerArguments (expr_parser_compiler_args);
- ClangExpressionParser parser(exe_scope, *this, expr_parser_compiler_args, generate_debug_info);
+ ClangExpressionParser parser(exe_scope, *this, generate_debug_info);
unsigned num_errors = parser.Parse (error_stream);
diff --git a/lldb/source/Expression/ClangUtilityFunction.cpp b/lldb/source/Expression/ClangUtilityFunction.cpp
index 72031153bdb..de5b0c1b03f 100644
--- a/lldb/source/Expression/ClangUtilityFunction.cpp
+++ b/lldb/source/Expression/ClangUtilityFunction.cpp
@@ -122,9 +122,7 @@ ClangUtilityFunction::Install (Stream &error_stream,
}
const bool generate_debug_info = true;
- Args expr_parser_compiler_args;
- target->GetExprParserCompilerArguments (expr_parser_compiler_args);
- ClangExpressionParser parser(exe_ctx.GetBestExecutionContextScope(), *this, expr_parser_compiler_args, generate_debug_info);
+ ClangExpressionParser parser(exe_ctx.GetBestExecutionContextScope(), *this, generate_debug_info);
unsigned num_errors = parser.Parse (error_stream);
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 71340a5ff95..56fe53712d6 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -647,20 +647,6 @@ Args::ParseOptions (Options &options)
}
OptionParser::Prepare();
int val;
-
- // Before parsing arguments, insert quote char to the head of the string.
- // So quoted arguments like "-l" won't be treated as option.
- int argv_iter = 0;
- for (auto args_iter = m_args.begin(); args_iter != m_args.end(); args_iter++, argv_iter++)
- {
- char quote_char = GetArgumentQuoteCharAtIndex(argv_iter);
- if (quote_char != '\0')
- {
- *args_iter = std::string(1, quote_char) + *args_iter;
- m_argv[argv_iter] = args_iter->c_str();
- }
- }
-
while (1)
{
int long_options_index = -1;
@@ -710,23 +696,8 @@ Args::ParseOptions (Options &options)
}
else
{
- const char *value = OptionParser::GetOptionArgument();
- if (value)
- {
- // Remove leading quote char from option value
- argv_iter = 0;
- for (auto args_iter = m_args.begin(); args_iter != m_args.end(); args_iter++, argv_iter++)
- {
- if (*args_iter == value && GetArgumentQuoteCharAtIndex(argv_iter) != '\0')
- {
- *args_iter = args_iter->substr(1);
- value = args_iter->c_str();
- break;
- }
- }
- }
error = options.SetOptionValue(long_options_index,
- (def->option_has_arg == OptionParser::eNoArgument) ? nullptr : value);
+ (def->option_has_arg == OptionParser::eNoArgument) ? nullptr : OptionParser::GetOptionArgument());
}
}
else
@@ -740,19 +711,6 @@ Args::ParseOptions (Options &options)
// Update our ARGV now that get options has consumed all the options
m_argv.erase(m_argv.begin(), m_argv.begin() + OptionParser::GetOptionIndex());
UpdateArgsAfterOptionParsing ();
-
- // Remove leading quote char from other arguments.
- argv_iter = 0;
- for (auto args_iter = m_args.begin(); args_iter != m_args.end(); args_iter++, argv_iter++)
- {
- char quote_char = GetArgumentQuoteCharAtIndex(argv_iter);
- if (quote_char != '\0')
- {
- *args_iter = args_iter->substr(1);
- m_argv[argv_iter] = args_iter->c_str();
- }
- }
-
return error;
}
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 8496463771c..badbab3ff3e 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2672,7 +2672,6 @@ g_properties[] =
{ "breakpoints-use-platform-avoid-list", OptionValue::eTypeBoolean , false, true , NULL, NULL, "Consult the platform module avoid list when setting non-module specific breakpoints." },
{ "arg0" , OptionValue::eTypeString , false, 0 , NULL, NULL, "The first argument passed to the program in the argument array which can be different from the executable itself." },
{ "run-args" , OptionValue::eTypeArgs , false, 0 , NULL, NULL, "A list containing all the arguments to be passed to the executable when it is run. Note that this does NOT include the argv[0] which is in target.arg0." },
- { "expr-parser-compiler-args" , OptionValue::eTypeArgs , false, 0 , NULL, NULL, "A list containing all the arguments to be passed to the expression parser compiler." },
{ "env-vars" , OptionValue::eTypeDictionary, false, OptionValue::eTypeString , NULL, NULL, "A list of all the environment variables to be passed to the executable's environment, and their values." },
{ "inherit-env" , OptionValue::eTypeBoolean , false, true , NULL, NULL, "Inherit the environment from the process that is running LLDB." },
{ "input-path" , OptionValue::eTypeFileSpec , false, 0 , NULL, NULL, "The file/path to be used by the executable program for reading its standard input." },
@@ -2721,7 +2720,6 @@ enum
ePropertyBreakpointUseAvoidList,
ePropertyArg0,
ePropertyRunArgs,
- ePropertyExprParserCompilerArgs,
ePropertyEnvVars,
ePropertyInheritEnv,
ePropertyInputPath,
@@ -2978,20 +2976,6 @@ TargetProperties::GetRunArguments (Args &args) const
}
void
-TargetProperties::SetExprParserCompilerArguments (const Args &args)
-{
- const uint32_t idx = ePropertyExprParserCompilerArgs;
- m_collection_sp->SetPropertyAtIndexFromArgs (NULL, idx, args);
-}
-
-bool
-TargetProperties::GetExprParserCompilerArguments (Args &args) const
-{
- const uint32_t idx = ePropertyExprParserCompilerArgs;
- return m_collection_sp->GetPropertyAtIndexAsArgs (NULL, idx, args);
-}
-
-void
TargetProperties::SetRunArguments (const Args &args)
{
const uint32_t idx = ePropertyRunArgs;
OpenPOWER on IntegriCloud