mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
Make 'unset_option' work on list options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c5e5498058
commit
b6c3483905
@ -2127,18 +2127,18 @@ class EmitPreprocessOptionsCallback : ActionHandlingCallbackBase {
|
||||
void onUnsetOption(Init* i, unsigned IndentLevel, raw_ostream& O) {
|
||||
const std::string& OptName = InitPtrToString(i);
|
||||
const OptionDescription& OptDesc = OptDescs_.FindOption(OptName);
|
||||
const OptionType::OptionType OptType = OptDesc.Type;
|
||||
|
||||
if (OptType == OptionType::Switch) {
|
||||
if (OptDesc.isSwitch()) {
|
||||
O.indent(IndentLevel) << OptDesc.GenVariableName() << " = false;\n";
|
||||
}
|
||||
else if (OptType == OptionType::Parameter
|
||||
|| OptType == OptionType::Prefix) {
|
||||
else if (OptDesc.isParameter()) {
|
||||
O.indent(IndentLevel) << OptDesc.GenVariableName() << " = \"\";\n";
|
||||
}
|
||||
else if (OptDesc.isList()) {
|
||||
O.indent(IndentLevel) << OptDesc.GenVariableName() << ".clear();\n";
|
||||
}
|
||||
else {
|
||||
throw std::string("'unset_option' can only be applied to "
|
||||
"switches or parameter/prefix options.");
|
||||
throw "Can't apply 'unset_option' to alias option '" + OptName + "'";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user