Print getresult instruction properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-02-22 03:10:23 +00:00
parent ec25f24dbf
commit 452743e5e4

View File

@ -1291,6 +1291,19 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
writeOperand(I.getOperand(op ), false); Out << ',';
writeOperand(I.getOperand(op+1), false); Out << " ]";
}
} else if (isa<GetResultInst>(I)) {
const StructType *STy = cast<StructType>(I.getOperand(0)->getType());
unsigned NumElems = STy->getNumElements();
Out << " {";
for (unsigned i = 0; i < NumElems; ++i) {
if (i)
Out << ",";
Out << " ";
printType(STy->getElementType(i));
}
Out << " }";
writeOperand(I.getOperand(0), false);
Out << ", " << cast<GetResultInst>(I).getIndex();
} else if (isa<ReturnInst>(I)) {
if (!Operand)
Out << " void";