[llvm-commits] [llvm] r90785 - /llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
Mikhail Glushenkov
foldr at codedgers.com
Mon Dec 7 11:16:13 PST 2009
Author: foldr
Date: Mon Dec 7 13:16:13 2009
New Revision: 90785
URL: http://llvm.org/viewvc/llvm-project?rev=90785&view=rev
Log:
Simplify a bit.
Modified:
llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=90785&r1=90784&r2=90785&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Mon Dec 7 13:16:13 2009
@@ -1823,20 +1823,17 @@
{
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 @@
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";
}
More information about the llvm-commits
mailing list