From: Mikhail Glushenkov Date: Mon, 7 Dec 2009 19:16:13 +0000 (+0000) Subject: Simplify a bit. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bc39a795f46ef04326915d881dc1d861144e3e19;p=oota-llvm.git Simplify a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90785 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 24530352d57..613ae03f45f 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1823,20 +1823,17 @@ class EmitActionHandlersCallback { checkNumberOfArguments(&Dag, 1); const std::string& Name = InitPtrToString(Dag.getArg(0)); - const OptionDescription& D = OptDescs.FindOption(Name); + const OptionDescription& D = OptDescs.FindListOrParameter(Name); if (D.isParameter()) { O.indent(IndentLevel) << "vec.push_back(" << D.GenVariableName() << ");\n"; } - else if (D.isList()) { + else { O.indent(IndentLevel) << "std::copy(" << D.GenVariableName() << ".begin(), " << D.GenVariableName() << ".end(), std::back_inserter(vec));\n"; } - else { - throw "'forward_value' used with a switch or an alias!"; - } } void onForwardTransformedValue (const DagInit& Dag, @@ -1845,15 +1842,10 @@ class EmitActionHandlersCallback checkNumberOfArguments(&Dag, 2); const std::string& Name = InitPtrToString(Dag.getArg(0)); const std::string& Hook = InitPtrToString(Dag.getArg(1)); - const OptionDescription& D = OptDescs.FindOption(Name); + const OptionDescription& D = OptDescs.FindListOrParameter(Name); - if (D.isParameter() || D.isList()) { - O.indent(IndentLevel) << "vec.push_back(" << "hooks::" - << Hook << "(" << D.GenVariableName() << "));\n"; - } - else { - throw "'forward_transformed_value' used with a switch or an alias!"; - } + O.indent(IndentLevel) << "vec.push_back(" << "hooks::" + << Hook << "(" << D.GenVariableName() << "));\n"; }