summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-21 04:23:39 +0000
committerChris Lattner <sabre@nondot.org>2010-09-21 04:23:39 +0000
commite8e2e80f40495fdd5ad475beb54fcf0989b6b7c5 (patch)
treee8d11d49ad7ea426ec7940f1c3e38f69a8408ba9 /lib/CodeGen/MachineInstr.cpp
parent22481f2ea18ce80c96dd5b554376b31727213f51 (diff)
downloadllvm-e8e2e80f40495fdd5ad475beb54fcf0989b6b7c5.tar.gz
llvm-e8e2e80f40495fdd5ad475beb54fcf0989b6b7c5.tar.bz2
llvm-e8e2e80f40495fdd5ad475beb54fcf0989b6b7c5.tar.xz
refactor the Value*/offset pair from MachineMemOperand out to a new
MachinePointerInfo struct, no functionality change. This also adds an assert to MachineMemOperand::MachineMemOperand that verifies that the Value* is either null or is an IR pointer type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 446e461d54..08871b0a7b 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -337,8 +337,9 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
MachineMemOperand::MachineMemOperand(const Value *v, unsigned int f,
int64_t o, uint64_t s, unsigned int a)
- : Offset(o), Size(s), V(v),
+ : PtrInfo(v, o), Size(s),
Flags((f & ((1 << MOMaxBits) - 1)) | ((Log2_32(a) + 1) << MOMaxBits)) {
+ assert((v == 0 || isa<PointerType>(v->getType())) && "invalid pointer value");
assert(getBaseAlignment() == a && "Alignment is not a power of 2!");
assert((isLoad() || isStore()) && "Not a load/store!");
}
@@ -346,9 +347,9 @@ MachineMemOperand::MachineMemOperand(const Value *v, unsigned int f,
/// Profile - Gather unique data for the object.
///
void MachineMemOperand::Profile(FoldingSetNodeID &ID) const {
- ID.AddInteger(Offset);
+ ID.AddInteger(getOffset());
ID.AddInteger(Size);
- ID.AddPointer(V);
+ ID.AddPointer(getValue());
ID.AddInteger(Flags);
}
@@ -364,8 +365,7 @@ void MachineMemOperand::refineAlignment(const MachineMemOperand *MMO) {
((Log2_32(MMO->getBaseAlignment()) + 1) << MOMaxBits);
// Also update the base and offset, because the new alignment may
// not be applicable with the old ones.
- V = MMO->getValue();
- Offset = MMO->getOffset();
+ PtrInfo = MMO->PtrInfo;
}
}