diff options
author | Tim Northover <Tim.Northover@arm.com> | 2013-02-11 14:25:52 +0000 |
---|---|---|
committer | Tim Northover <Tim.Northover@arm.com> | 2013-02-11 14:25:52 +0000 |
commit | 716d26b2ce310e852a78b25ec94db031378133bb (patch) | |
tree | e1258ecb8fef35a2a82fc95ceaeca735de75550c | |
parent | fd980723b66f9eaa3d4bd43fb00e541de1c9853f (diff) | |
download | external_llvm-716d26b2ce310e852a78b25ec94db031378133bb.zip external_llvm-716d26b2ce310e852a78b25ec94db031378133bb.tar.gz external_llvm-716d26b2ce310e852a78b25ec94db031378133bb.tar.bz2 |
AArch64: fix build on some MSVC versions
This does two things:
It removes a call to abs() which may have "long long" parameter on Windows,
which is not necessarily available in C++03.
It also corrects the signedness of Amount, which was relying on
implementation-defined conversions previously.
Code was already tested (albeit in an implemnetation defined way) so no extra
tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174885 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/AArch64/AArch64RegisterInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/AArch64/AArch64RegisterInfo.cpp b/lib/Target/AArch64/AArch64RegisterInfo.cpp index da45685..ee34d76 100644 --- a/lib/Target/AArch64/AArch64RegisterInfo.cpp +++ b/lib/Target/AArch64/AArch64RegisterInfo.cpp @@ -165,8 +165,8 @@ AArch64RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF, if (!TFI->hasReservedCallFrame(MF)) { unsigned Align = TFI->getStackAlignment(); - uint64_t Amount = MI->getOperand(0).getImm(); - Amount = (Amount + Align - 1)/Align * Align; + int64_t Amount = MI->getOperand(0).getImm(); + Amount = RoundUpToAlignment(Amount, Align); if (!IsDestroy) Amount = -Amount; // N.b. if CalleePopAmount is valid but zero (i.e. callee would pop, but it @@ -177,7 +177,7 @@ AArch64RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF, // because there's no guaranteed temporary register available. Mostly call // frames will be allocated at the start of a function so this is OK, but // it is a limitation that needs dealing with. - assert(abs(Amount) < 0xfff && "call frame too large"); + assert(Amount > -0xfff && Amount < 0xfff && "call frame too large"); emitSPUpdate(MBB, MI, dl, TII, AArch64::NoRegister, Amount); } } else if (CalleePopAmount != 0) { |