Fix test failure introduced by r245521.
authorAlex Lorenz <arphaman@gmail.com>
Wed, 19 Aug 2015 23:56:37 +0000 (23:56 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 19 Aug 2015 23:56:37 +0000 (23:56 +0000)
Machine memory operands can contain pointer values that are constants, and
the 'getLocalSlot' method requires non-constant values.

The constant pointer values will have to be serialized in a different patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245523 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MIRPrinter.cpp

index e9ecba404b68ef6e762487ddf552e93dea0cf270..2440a4103d8f6381ca3207974cb3d32d51a10591 100644 (file)
@@ -614,6 +614,12 @@ void MIPrinter::printIRValueReference(const Value &V) {
     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));
 }