Make 'unset_option' work on list options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84827 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
   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 + "'";
     }
   }