[llvm-commits] [llvm] r83874 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Bob Wilson
bob.wilson at apple.com
Mon Oct 12 12:04:03 PDT 2009
Author: bwilson
Date: Mon Oct 12 14:04:03 2009
New Revision: 83874
URL: http://llvm.org/viewvc/llvm-project?rev=83874&view=rev
Log:
Use early exit to reduce indentation.
Modified:
llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=83874&r1=83873&r2=83874&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Oct 12 14:04:03 2009
@@ -956,28 +956,29 @@
MachineBasicBlock *&NewMBB) {
water_iterator IPThatWouldPad;
MachineBasicBlock* WaterBBThatWouldPad = NULL;
- if (!WaterList.empty()) {
- for (water_iterator IP = prior(WaterList.end()),
- B = WaterList.begin();; --IP) {
- MachineBasicBlock* WaterBB = *IP;
- if (WaterIsInRange(UserOffset, WaterBB, U)) {
- unsigned WBBId = WaterBB->getNumber();
- if (isThumb &&
- (BBOffsets[WBBId] + BBSizes[WBBId])%4 != 0) {
- // This is valid Water, but would introduce padding. Remember
- // it in case we don't find any Water that doesn't do this.
- if (!WaterBBThatWouldPad) {
- WaterBBThatWouldPad = WaterBB;
- IPThatWouldPad = IP;
- }
- } else {
- NewMBB = AcceptWater(WaterBB, IP);
- return true;
+ if (WaterList.empty())
+ return false;
+
+ for (water_iterator IP = prior(WaterList.end()),
+ B = WaterList.begin();; --IP) {
+ MachineBasicBlock* WaterBB = *IP;
+ if (WaterIsInRange(UserOffset, WaterBB, U)) {
+ unsigned WBBId = WaterBB->getNumber();
+ if (isThumb &&
+ (BBOffsets[WBBId] + BBSizes[WBBId])%4 != 0) {
+ // This is valid Water, but would introduce padding. Remember
+ // it in case we don't find any Water that doesn't do this.
+ if (!WaterBBThatWouldPad) {
+ WaterBBThatWouldPad = WaterBB;
+ IPThatWouldPad = IP;
}
+ } else {
+ NewMBB = AcceptWater(WaterBB, IP);
+ return true;
}
- if (IP == B)
- break;
}
+ if (IP == B)
+ break;
}
if (isThumb && WaterBBThatWouldPad) {
NewMBB = AcceptWater(WaterBBThatWouldPad, IPThatWouldPad);
More information about the llvm-commits
mailing list