Decoupled Options from CommandInterpreter.
Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
This commit is contained in:
@@ -52,9 +52,9 @@ OptionGroupOutputFile::GetDefinitions ()
|
||||
}
|
||||
|
||||
Error
|
||||
OptionGroupOutputFile::SetOptionValue (CommandInterpreter &interpreter,
|
||||
uint32_t option_idx,
|
||||
const char *option_arg)
|
||||
OptionGroupOutputFile::SetOptionValue(uint32_t option_idx,
|
||||
const char *option_arg,
|
||||
ExecutionContext *execution_context)
|
||||
{
|
||||
Error error;
|
||||
const int short_option = g_option_table[option_idx].short_option;
|
||||
@@ -78,7 +78,8 @@ OptionGroupOutputFile::SetOptionValue (CommandInterpreter &interpreter,
|
||||
}
|
||||
|
||||
void
|
||||
OptionGroupOutputFile::OptionParsingStarting (CommandInterpreter &interpreter)
|
||||
OptionGroupOutputFile::OptionParsingStarting(
|
||||
ExecutionContext *execution_context)
|
||||
{
|
||||
m_file.Clear();
|
||||
m_append.Clear();
|
||||
|
||||
Reference in New Issue
Block a user