MIR Serialization: Serialize the pointer IR expression values in the machine
[oota-llvm.git] / lib / CodeGen / MIRPrinter.cpp
index aa3d193695a710a911bebd190fc0fd525cc1cbb2..05bb320d8e6b3a4b3ff8b01086395cd60ce19cfc 100644 (file)
@@ -613,17 +613,18 @@ void MIPrinter::printIRValueReference(const Value &V) {
     V.printAsOperand(OS, /*PrintType=*/false, MST);
     return;
   }
+  if (isa<Constant>(V)) {
+    // Machine memory operands can load/store to/from constant value pointers.
+    OS << '`';
+    V.printAsOperand(OS, /*PrintType=*/true, MST);
+    OS << '`';
+    return;
+  }
   OS << "%ir.";
   if (V.hasName()) {
     printLLVMNameWithoutPrefix(OS, V.getName());
     return;
   }
-  if (isa<Constant>(V)) {
-    // Machine memory operands can load/store to/from constant value pointers.
-    // TODO: Serialize the constant values.
-    OS << "<unserializable ir value>";
-    return;
-  }
   printIRSlotNumber(OS, MST.getLocalSlot(&V));
 }