1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Print ret instruction that returns aggregates.

llvm-svn: 47472
This commit is contained in:
Devang Patel 2008-02-22 02:50:49 +00:00
parent 8ae63af4b1
commit 2754d59c53

View File

@ -1291,8 +1291,23 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
writeOperand(I.getOperand(op ), false); Out << ',';
writeOperand(I.getOperand(op+1), false); Out << " ]";
}
} else if (isa<ReturnInst>(I) && !Operand) {
} else if (isa<ReturnInst>(I)) {
if (!Operand)
Out << " void";
else {
if (I.getOperand(0)->getType()->isFirstClassType())
writeOperand(I.getOperand(0), true);
else {
Constant *ROp = cast<Constant>(I.getOperand(0));
const StructType *STy = cast<StructType>(ROp->getType());
unsigned NumElems = STy->getNumElements();
for (unsigned i = 0; i < NumElems; ++i) {
if (i)
Out << ",";
writeOperand(ROp->getOperand(i), true);
}
}
}
} else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
// Print the calling convention being used.
switch (CI->getCallingConv()) {