writeOperand(I.getOperand(op ), false); Out << ',';
writeOperand(I.getOperand(op+1), false); Out << " ]";
}
- } else if (isa<ReturnInst>(I) && !Operand) {
- Out << " void";
+ } 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()) {