Print getresult instruction properly.
authorDevang Patel <dpatel@apple.com>
Fri, 22 Feb 2008 03:10:23 +0000 (03:10 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 22 Feb 2008 03:10:23 +0000 (03:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47473 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index b1f15c676f0d1607fc9a90f25290013e5f2c144b..d376e7f611ddb6e2cea5bc89b0ea25d5753714a6 100644 (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";