diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-01-01 03:51:02 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-01-01 03:51:02 +0000 |
commit | d64c90776e973c38671cd62c18ddfc1344162b98 (patch) | |
tree | 597900d72d184c323c45a8bc310ab6e700e9387e /utils/TableGen/LLVMCConfigurationEmitter.cpp | |
parent | 3a481e38c9219b0267562c6bc8d3ab8041294c8e (diff) | |
download | llvm-d64c90776e973c38671cd62c18ddfc1344162b98.tar.gz llvm-d64c90776e973c38671cd62c18ddfc1344162b98.tar.bz2 llvm-d64c90776e973c38671cd62c18ddfc1344162b98.tar.xz |
Make CheckForSuperfluousOptions handle list form of 'switch_on' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/LLVMCConfigurationEmitter.cpp')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 42cedf2c69..571999f1ab 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1086,14 +1086,28 @@ class ExtractOptionNames { if (ActionName == "forward" || ActionName == "forward_as" || ActionName == "forward_value" || ActionName == "forward_transformed_value" || - ActionName == "switch_on" || ActionName == "parameter_equals" || + ActionName == "switch_on" || ActionName == "any_switch_on" || + ActionName == "parameter_equals" || ActionName == "element_in_list" || ActionName == "not_empty" || ActionName == "empty") { CheckNumberOfArguments(Stmt, 1); - const std::string& Name = InitPtrToString(Stmt.getArg(0)); - OptionNames_.insert(Name); + + Init* Arg = Stmt.getArg(0); + if (typeid(*Arg) == typeid(StringInit)) { + const std::string& Name = InitPtrToString(Arg); + OptionNames_.insert(Name); + } + else { + // It's a list. + const ListInit& List = InitPtrToList(Arg); + for (ListInit::const_iterator B = List.begin(), E = List.end(); + B != E; ++B) { + const std::string& Name = InitPtrToString(*B); + OptionNames_.insert(Name); + } + } } - else if (ActionName == "and" || ActionName == "or") { + else if (ActionName == "and" || ActionName == "or" || ActionName == "not") { for (unsigned i = 0, NumArgs = Stmt.getNumArgs(); i < NumArgs; ++i) { this->processDag(Stmt.getArg(i)); } @@ -2895,7 +2909,6 @@ void CheckPluginData(PluginData& Data) { // Check that there are no options without side effects (specified // only in the OptionList). CheckForSuperfluousOptions(Data.Edges, Data.ToolDescs, Data.OptDescs); - } void EmitPluginCode(const PluginData& Data, raw_ostream& O) { |