aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-10-22 04:15:07 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-10-22 04:15:07 +0000
commitb6c3483905744b812e03b6894baaae25b27a3259 (patch)
tree25f9a6171e4ab4e40a53e19ab134645c6368a1c3
parentc5e5498058718961504012c487a471e7c0b410b9 (diff)
downloadexternal_llvm-b6c3483905744b812e03b6894baaae25b27a3259.zip
external_llvm-b6c3483905744b812e03b6894baaae25b27a3259.tar.gz
external_llvm-b6c3483905744b812e03b6894baaae25b27a3259.tar.bz2
Make 'unset_option' work on list options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84827 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 4293c95..f5d1139 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -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 + "'";
}
}