summaryrefslogtreecommitdiffstats
path: root/llvm/utils
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
commit3b3e9a1c27b21dc5d4547896d1096c22465935d7 (patch)
treea14ecf1a18303bb354ab797ee1240802647bdc9c /llvm/utils
parent14487993778db3d3896f2445baf6b16e70e049b6 (diff)
downloadbcm5719-llvm-3b3e9a1c27b21dc5d4547896d1096c22465935d7.tar.gz
bcm5719-llvm-3b3e9a1c27b21dc5d4547896d1096c22465935d7.zip
Make 'unset_option' work on list options.
llvm-svn: 84827
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 4293c95fd2f..f5d1139bb62 100644
--- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/llvm/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 + "'";
}
}
OpenPOWER on IntegriCloud