* Wrap long lines
* Replace silent fall-through FIXME comments with an error to cerr and an abort
* No need to set size of statically initialized arrays


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14404 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index 712a69d..96920ec 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -368,8 +368,10 @@
     unsigned Reg1 = makeAnotherReg(V->getType());
     unsigned Reg2 = makeAnotherReg(V->getType());
     // Move the address of the global into the register
-    BuildMI(*MBB, IPt, PPC32::LOADHiAddr, 2, Reg1).addReg(PPC32::R0).addGlobalAddress(GV);
-    BuildMI(*MBB, IPt, PPC32::LOADLoAddr, 2, Reg2).addReg(Reg1).addGlobalAddress(GV);
+    BuildMI(*MBB, IPt, PPC32::LOADHiAddr, 2, Reg1).addReg(PPC32::R0)
+      .addGlobalAddress(GV);
+    BuildMI(*MBB, IPt, PPC32::LOADLoAddr, 2, Reg2).addReg(Reg1)i
+      .addGlobalAddress(GV);
     return Reg2;
   } else if (CastInst *CI = dyn_cast<CastInst>(V)) {
     // Do not emit noop casts at all.
@@ -483,9 +485,12 @@
       uint64_t Val = cast<ConstantInt>(C)->getRawValue();
       unsigned hiTmp = makeAnotherReg(Type::IntTy);
       unsigned loTmp = makeAnotherReg(Type::IntTy);
-      BuildMI(*MBB, IP, PPC32::ADDIS, 2, loTmp).addReg(PPC32::R0).addImm(Val >> 48);
-      BuildMI(*MBB, IP, PPC32::ORI, 2, R).addReg(loTmp).addImm((Val >> 32) & 0xFFFF);
-      BuildMI(*MBB, IP, PPC32::ADDIS, 2, hiTmp).addReg(PPC32::R0).addImm((Val >> 16) & 0xFFFF);
+      BuildMI(*MBB, IP, PPC32::ADDIS, 2, loTmp).addReg(PPC32::R0)
+        .addImm(Val >> 48);
+      BuildMI(*MBB, IP, PPC32::ORI, 2, R).addReg(loTmp)
+        .addImm((Val >> 32) & 0xFFFF);
+      BuildMI(*MBB, IP, PPC32::ADDIS, 2, hiTmp).addReg(PPC32::R0)
+        .addImm((Val >> 16) & 0xFFFF);
       BuildMI(*MBB, IP, PPC32::ORI, 2, R+1).addReg(hiTmp).addImm(Val & 0xFFFF);
       return;
     }
@@ -493,19 +498,24 @@
     assert(Class <= cInt && "Type not handled yet!");
 
     if (C->getType() == Type::BoolTy) {
-      BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0).addImm(C == ConstantBool::True);
+      BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0)
+        .addImm(C == ConstantBool::True);
     } else if (Class == cByte || Class == cShort) {
       ConstantInt *CI = cast<ConstantInt>(C);
-      BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0).addImm(CI->getRawValue());
+      BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0)
+        .addImm(CI->getRawValue());
     } else {
       ConstantInt *CI = cast<ConstantInt>(C);
       int TheVal = CI->getRawValue() & 0xFFFFFFFF;
       if (TheVal < 32768 && TheVal >= -32768) {
-        BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0).addImm(CI->getRawValue());
+        BuildMI(*MBB, IP, PPC32::ADDI, 2, R).addReg(PPC32::R0)
+          .addImm(CI->getRawValue());
       } else {
         unsigned TmpReg = makeAnotherReg(Type::IntTy);
-        BuildMI(*MBB, IP, PPC32::ADDIS, 2, TmpReg).addReg(PPC32::R0).addImm(CI->getRawValue() >> 16);
-        BuildMI(*MBB, IP, PPC32::ORI, 2, R).addReg(TmpReg).addImm(CI->getRawValue() & 0xFFFF);
+        BuildMI(*MBB, IP, PPC32::ADDIS, 2, TmpReg).addReg(PPC32::R0)
+          .addImm(CI->getRawValue() >> 16);
+        BuildMI(*MBB, IP, PPC32::ORI, 2, R).addReg(TmpReg)
+          .addImm(CI->getRawValue() & 0xFFFF);
       }
     }
   } else if (ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
@@ -514,7 +524,7 @@
       unsigned CPI = CP->getConstantPoolIndex(CFP);
       const Type *Ty = CFP->getType();
 
-      assert(Ty == Type::FloatTy || Ty == Type::DoubleTy && "Unknown FP type!"); 
+      assert(Ty == Type::FloatTy || Ty == Type::DoubleTy && "Unknown FP type!");
       unsigned LoadOpcode = Ty == Type::FloatTy ? PPC32::LFS : PPC32::LFD;
       addConstantPoolReference(BuildMI(*MBB, IP, LoadOpcode, 2, R), CPI);
   } else if (isa<ConstantPointerNull>(C)) {
@@ -848,6 +858,8 @@
         //
 
         // FIXME: Not Yet Implemented
+        std::cerr << "EmitComparison unimplemented: Opnum >= 2\n";
+        abort();
         return OpNum;
       }
     }
@@ -887,6 +899,8 @@
       //
 
       // FIXME: Not Yet Implemented
+      std::cerr << "EmitComparison (cLong) unimplemented: Opnum >= 2\n";
+      abort();
       return OpNum;
     }
   }
@@ -1537,7 +1551,7 @@
     }
 
   // General case.
-  static const unsigned OpcodeTab[4] = {
+  static const unsigned OpcodeTab[] = {
     PPC32::FADD, PPC32::FSUB, PPC32::FMUL, PPC32::FDIV
   };
 
@@ -1561,7 +1575,7 @@
   unsigned Class = getClassB(Op0->getType());
 
   // Arithmetic and Bitwise operators
-  static const unsigned OpcodeTab[5] = {
+  static const unsigned OpcodeTab[] = {
     PPC32::ADD, PPC32::SUB, PPC32::AND, PPC32::OR, PPC32::XOR
   };
   // Otherwise, code generate the full operation with a constant.