mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-25 00:33:15 +00:00
Print ret instruction that returns aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47472 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
197be3de7f
commit
ec25f24dbf
@ -1291,8 +1291,23 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
|
|||||||
writeOperand(I.getOperand(op ), false); Out << ',';
|
writeOperand(I.getOperand(op ), false); Out << ',';
|
||||||
writeOperand(I.getOperand(op+1), false); Out << " ]";
|
writeOperand(I.getOperand(op+1), false); Out << " ]";
|
||||||
}
|
}
|
||||||
} else if (isa<ReturnInst>(I) && !Operand) {
|
} else if (isa<ReturnInst>(I)) {
|
||||||
Out << " void";
|
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)) {
|
} else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
|
||||||
// Print the calling convention being used.
|
// Print the calling convention being used.
|
||||||
switch (CI->getCallingConv()) {
|
switch (CI->getCallingConv()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user