From 4b2ebc19288491cb068f268c311d9fef0ec6a29f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 25 Sep 2009 23:33:20 +0000 Subject: Move MachineMemOperand::getAlignment out of line, to avoid needing MathExtras.h in MachineMemOperand.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82822 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/MachineInstr.cpp') diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 2d06aa4799..ae6f3f5d5f 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -315,6 +315,12 @@ void MachineMemOperand::refineAlignment(const MachineMemOperand *MMO) { } } +/// getAlignment - Return the minimum known alignment in bytes of the +/// actual memory reference. +uint64_t MachineMemOperand::getAlignment() const { + return MinAlign(getBaseAlignment(), getOffset()); +} + raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineMemOperand &MMO) { assert((MMO.isLoad() || MMO.isStore()) && "SV has to be a load, store or both."); -- cgit v1.2.3