[MIR] Teach the printer how to print complex types for generic machine instructions.
authorQuentin Colombet <qcolombet@apple.com>
Tue, 8 Mar 2016 00:38:01 +0000 (00:38 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Tue, 8 Mar 2016 00:38:01 +0000 (00:38 +0000)
Before this change, we would get the type definition in the middle
of the instruction.
E.g., %0(48) = G_ADD %struct_alias = type { i32, i16 } %edi, %edi

Now, we have just the expected type name:
%0(48) = G_ADD %struct_alias %edi, %edi

llvm-svn: 262885

llvm/lib/CodeGen/MIRPrinter.cpp

index 6c3c63f..5803601 100644 (file)
@@ -554,7 +554,8 @@ void MIPrinter::print(const MachineInstr &MI) {
   OS << TII->getName(MI.getOpcode());
   if (isPreISelGenericOpcode(MI.getOpcode())) {
     assert(MI.getType() && "Generic instructions must have a type");
-    OS << ' ' << *MI.getType();
+    OS << ' ';
+    MI.getType()->print(OS, /*IsForDebug*/ false, /*NoDetails*/ true);
   }
   if (I < E)
     OS << ' ';