mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 00:11:00 +00:00
Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90785 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
06d266170b
commit
bc39a795f4
@ -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";
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user