diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-12-07 19:16:13 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-12-07 19:16:13 +0000 |
commit | bc39a795f46ef04326915d881dc1d861144e3e19 (patch) | |
tree | 488a3e9abcc7ea69abcf1f44a689a9068ffd77cd /utils/TableGen | |
parent | 06d266170b5a2dd2af621735ce7826593af19448 (diff) | |
download | external_llvm-bc39a795f46ef04326915d881dc1d861144e3e19.zip external_llvm-bc39a795f46ef04326915d881dc1d861144e3e19.tar.gz external_llvm-bc39a795f46ef04326915d881dc1d861144e3e19.tar.bz2 |
Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 2453035..613ae03 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"; } |