]> granicus.if.org Git - llvm/commitdiff
[llvm] FIx if-clause -Wmisleading-indentation issue.
authorKirill Bobyrev <omtcyfz@gmail.com>
Wed, 2 Nov 2016 10:00:40 +0000 (10:00 +0000)
committerKirill Bobyrev <omtcyfz@gmail.com>
Wed, 2 Nov 2016 10:00:40 +0000 (10:00 +0000)
While bootstrapping Clang with recent `gcc 6.2.0` I found a bug related to misleading indentation.

I believe, a pair of `{}` was forgotten, especially given the above similar piece of code:

```
      if (!RDef || !HII->isPredicable(*RDef)) {
        Done = coalesceRegisters(RD, RegisterRef(S1));
        if (Done) {
          UpdRegs.insert(RD.Reg);
          UpdRegs.insert(S1.getReg());
        }
      }
```

Reviewers: kparzysz

Differential Revision: https://reviews.llvm.org/D26204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285794 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonExpandCondsets.cpp

index 2760e16bd0f9fcd4c26d61fba0c47d836320c4f6..15ffa1c4c66139fdce56582b630172f0fbfcd803 100644 (file)
@@ -1174,12 +1174,13 @@ bool HexagonExpandCondsets::coalesceSegments(
     if (!Done && S2.isReg()) {
       RegisterRef RS = S2;
       MachineInstr *RDef = getReachingDefForPred(RS, CI, RP.Reg, false);
-      if (!RDef || !HII->isPredicable(*RDef))
+      if (!RDef || !HII->isPredicable(*RDef)) {
         Done = coalesceRegisters(RD, RegisterRef(S2));
         if (Done) {
           UpdRegs.insert(RD.Reg);
           UpdRegs.insert(S2.getReg());
         }
+      }
     }
     Changed |= Done;
   }