From 83127739ff89d3e689b8c15bacf538331b960039 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Fri, 7 Aug 2015 20:26:52 +0000 Subject: MIR Serialization: Serialize the offsets for the machine memory operands. llvm-svn: 244356 --- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 6 +++++- llvm/lib/CodeGen/MIRPrinter.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index af599a5cc3b..8874aaedfcf 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1125,12 +1125,16 @@ bool MIParser::parseMachineMemoryOperand(MachineMemOperand *&Dest) { if (!V->getType()->isPointerTy()) return error("expected a pointer IR value"); lex(); + int64_t Offset = 0; + if (parseOffset(Offset)) + return true; // TODO: Parse the base alignment. // TODO: Parse the attached metadata nodes. if (expectAndConsume(MIToken::rparen)) return true; - Dest = MF.getMachineMemOperand(MachinePointerInfo(V), Flags, Size, Size); + Dest = + MF.getMachineMemOperand(MachinePointerInfo(V, Offset), Flags, Size, Size); return false; } diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index e162a8f73e2..4710f168d3a 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -678,6 +678,7 @@ void MIPrinter::print(const MachineMemOperand &Op) { if (const Value *Val = Op.getValue()) printIRValueReference(*Val); // TODO: Print PseudoSourceValue. + printOffset(Op.getOffset()); // TODO: Print the base alignment. // TODO: Print the metadata attributes. OS << ')'; -- cgit v1.2.3