summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-12-07 19:16:13 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-12-07 19:16:13 +0000
commit57a67facb8398e98a17fac184f901c37a8194bee (patch)
tree54fb592f15dd6f7151399aa74d50700ccf574134 /llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
parentfca845187d8d798e1adb7a92229cb2f0eb407052 (diff)
downloadbcm5719-llvm-57a67facb8398e98a17fac184f901c37a8194bee.tar.gz
bcm5719-llvm-57a67facb8398e98a17fac184f901c37a8194bee.zip
Simplify a bit.
llvm-svn: 90785
Diffstat (limited to 'llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 24530352d57..613ae03f45f 100644
--- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/llvm/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";
}
OpenPOWER on IntegriCloud