diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-04-17 20:40:45 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-04-17 20:40:45 +0000 |
commit | 9bd06cf878a03ac3b7d4aa9324b3c9c800f2896c (patch) | |
tree | 60a46eba634cdb15ce31e9c14f473ff948209a50 /lib | |
parent | d891bf3d5a57806a444129ad9071f4e38f3a4d16 (diff) | |
download | external_llvm-9bd06cf878a03ac3b7d4aa9324b3c9c800f2896c.zip external_llvm-9bd06cf878a03ac3b7d4aa9324b3c9c800f2896c.tar.gz external_llvm-9bd06cf878a03ac3b7d4aa9324b3c9c800f2896c.tar.bz2 |
Rearrange code to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 79 |
1 files changed, 38 insertions, 41 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 446326d..2f330f8 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -405,25 +405,24 @@ static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, ARM::R3, ARM::NoRegister }; - if (unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 4)) { - unsigned i; - for (i = 0; i < 4; ++i) - if (HiRegList[i] == Reg) - break; + unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 4); + if (Reg == 0) + return false; // we didn't handle it - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, - MVT::i32, LocInfo)); - if (LoRegList[i] != ARM::NoRegister) - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], - MVT::i32, LocInfo)); - else - State.addLoc(CCValAssign::getCustomMem(ValNo, ValVT, - State.AllocateStack(4, 4), - MVT::i32, LocInfo)); - return true; // we handled it - } + unsigned i; + for (i = 0; i < 4; ++i) + if (HiRegList[i] == Reg) + break; - return false; // we didn't handle it + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, MVT::i32, LocInfo)); + if (LoRegList[i] != ARM::NoRegister) + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], + MVT::i32, LocInfo)); + else + State.addLoc(CCValAssign::getCustomMem(ValNo, ValVT, + State.AllocateStack(4, 4), + MVT::i32, LocInfo)); + return true; // we handled it } // AAPCS f64 is in aligned register pairs @@ -434,20 +433,19 @@ static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, static const unsigned HiRegList[] = { ARM::R0, ARM::R2 }; static const unsigned LoRegList[] = { ARM::R1, ARM::R3 }; - if (unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2)) { - unsigned i; - for (i = 0; i < 2; ++i) - if (HiRegList[i] == Reg) - break; + unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2); + if (Reg == 0) + return false; // we didn't handle it - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, - MVT::i32, LocInfo)); - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], - MVT::i32, LocInfo)); - return true; // we handled it - } + unsigned i; + for (i = 0; i < 2; ++i) + if (HiRegList[i] == Reg) + break; - return false; // we didn't handle it + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, MVT::i32, LocInfo)); + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], + MVT::i32, LocInfo)); + return true; // we handled it } static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, @@ -457,20 +455,19 @@ static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, static const unsigned HiRegList[] = { ARM::R0, ARM::R2 }; static const unsigned LoRegList[] = { ARM::R1, ARM::R3 }; - if (unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2)) { - unsigned i; - for (i = 0; i < 2; ++i) - if (HiRegList[i] == Reg) - break; + unsigned Reg = State.AllocateReg(HiRegList, LoRegList, 2); + if (Reg == 0) + return false; // we didn't handle it - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, - MVT::i32, LocInfo)); - State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], - MVT::i32, LocInfo)); - return true; // we handled it - } + unsigned i; + for (i = 0; i < 2; ++i) + if (HiRegList[i] == Reg) + break; - return false; // we didn't handle it + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, Reg, MVT::i32, LocInfo)); + State.addLoc(CCValAssign::getCustomReg(ValNo, ValVT, LoRegList[i], + MVT::i32, LocInfo)); + return true; // we handled it } static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, |