mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
Handle the last operand more intelligently. When emitting the \n, also
return from the asmprinter to make the generated asmprinter both more efficient and smaller. llvm-svn: 29182
This commit is contained in:
parent
2c14435831
commit
39569f417f
@ -345,12 +345,14 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
|
||||
if (Inst == 0) continue; // PHI, INLINEASM, etc.
|
||||
|
||||
std::string Command;
|
||||
if (Op > Inst->Operands.size())
|
||||
if (Op >= Inst->Operands.size())
|
||||
continue; // Instruction already done.
|
||||
else if (Op == Inst->Operands.size())
|
||||
Command = " return true;\n";
|
||||
else
|
||||
Command = " " + Inst->Operands[Op].getCode() + "\n";
|
||||
|
||||
Command = " " + Inst->Operands[Op].getCode() + "\n";
|
||||
|
||||
// If this is the last operand, emit a return.
|
||||
if (Op == Inst->Operands.size()-1)
|
||||
Command += " return true;\n";
|
||||
|
||||
// Check to see if we already have 'Command' in UniqueOperandCommands.
|
||||
// If not, add it.
|
||||
|
Loading…
Reference in New Issue
Block a user