summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-07 20:26:52 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-07 20:26:52 +0000
commit83127739ff89d3e689b8c15bacf538331b960039 (patch)
tree4e8b4917af46e2bf82eca54dcb56be0949f8080b /llvm/lib
parentdc24c1713e87dc6561ac01e36e54ff4bf924d8f4 (diff)
downloadbcm5719-llvm-83127739ff89d3e689b8c15bacf538331b960039.tar.gz
bcm5719-llvm-83127739ff89d3e689b8c15bacf538331b960039.zip
MIR Serialization: Serialize the offsets for the machine memory operands.
llvm-svn: 244356
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp6
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp1
2 files changed, 6 insertions, 1 deletions
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 << ')';
OpenPOWER on IntegriCloud