Patches to make the LLVM sources more -pedantic clean. Patch provided
authorChris Lattner <sabre@nondot.org>
Wed, 24 May 2006 17:04:05 +0000 (17:04 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 24 May 2006 17:04:05 +0000 (17:04 +0000)
by Anton Korobeynikov!  This is a step towards closing PR786.

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

42 files changed:
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/ScheduleDAG.h
lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/IPA/Andersens.cpp
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp
lib/Support/Compressor.cpp
lib/Support/IsInf.cpp
lib/Support/IsNAN.cpp
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/Alpha/AlphaISelLowering.h
lib/Target/Alpha/AlphaRelocations.h
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrInfo.h
lib/Target/PowerPC/PPCJITInfo.cpp
lib/Target/PowerPC/PPCRelocations.h
lib/Target/Sparc/Sparc.h
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/Sparc/SparcInstrInfo.h
lib/Target/Sparc/SparcSubtarget.cpp
lib/Target/TargetMachine.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86InstrBuilder.h
lib/Target/X86/X86InstrInfo.h
lib/Target/X86/X86JITInfo.cpp
lib/Target/X86/X86Relocations.h
lib/Transforms/Instrumentation/RSProfiling.cpp
lib/Transforms/Instrumentation/RSProfiling.h
lib/VMCore/Constants.cpp
tools/analyze/GraphPrinters.cpp
tools/bugpoint/ListReducer.h
tools/llvm-ar/llvm-ar.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvmc/CompilerDriver.h
tools/llvmc/ConfigLexer.h
tools/llvmc/ConfigLexer.l
tools/llvmc/ConfigLexer.l.cvs
tools/opt/GraphPrinters.cpp
utils/PerfectShuffle/PerfectShuffle.cpp
utils/TableGen/RegisterInfoEmitter.cpp

index 9cf2455f29ffc5e2cc73db38164157cf061dd6c7..35092b5536f3a997c301f9b1a15d1842b8ddffd9 100644 (file)
@@ -42,7 +42,7 @@ private:
   // Bit fields of the flags variable used for different operand properties
   enum {
     DEFFLAG     = 0x01,       // this is a def of the operand
-    USEFLAG     = 0x02,       // this is a use of the operand
+    USEFLAG     = 0x02        // this is a use of the operand
   };
 
 public:
index 128a74b735377b4936537a915496b40734f04efc..870d48af94d09b49974189a0e1ac1b6d28b77103 100644 (file)
@@ -41,7 +41,7 @@ namespace llvm {
     enum HazardType {
       NoHazard,      // This instruction can be emitted at this cycle.
       Hazard,        // This instruction can't be emitted at this cycle.
-      NoopHazard,    // This instruction can't be emitted, and needs noops.
+      NoopHazard     // This instruction can't be emitted, and needs noops.
     };
     
     /// getHazardType - Return the hazard type of emitting this node.  There are
index f6fca1fa961e21aa4290bfa58d1898ffeb1260df..4e326545cc5cc588a25270f6b4ccb6ae8e73a0a5 100644 (file)
@@ -43,7 +43,7 @@ namespace {
   DSAFieldLimit("dsa-field-limit", cl::Hidden,
                 cl::desc("Number of fields to track before collapsing a node"),
                 cl::init(256));
-};
+}
 
 #if 0
 #define TIME_REGION(VARNAME, DESC) \
index 877cf2ebd9fb677cbf0f9c7b1dd3c3c8b72eb411..11886936c868710cf0123d7ffe20b5c64c7f5229 100644 (file)
@@ -192,7 +192,7 @@ namespace {
     enum {
       UniversalSet = 0,
       NullPtr      = 1,
-      NullObject   = 2,
+      NullObject   = 2
     };
 
   public:
index 8d51f7f9384cf5283585248d483702c57f60715f..8c6a7b5fc7bd299a8df42e272d50503dc2603202 100644 (file)
@@ -59,7 +59,7 @@ namespace {
   EnableJoining("join-liveintervals",
                 cl::desc("Join compatible live intervals"),
                 cl::init(true));
-};
+}
 
 void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const
 {
index 3fbfbf927a3d2146a0b206e56194af136555f2c2..979305fa41a70eb5a205849d63883853c840c3ca 100644 (file)
@@ -65,7 +65,7 @@ class SelectionDAGLegalize {
   enum LegalizeAction {
     Legal,      // The target natively supports this operation.
     Promote,    // This operation should be executed in a larger type.
-    Expand,     // Try to expand this to other ops, otherwise use a libcall.
+    Expand      // Try to expand this to other ops, otherwise use a libcall.
   };
   
   /// ValueTypeActions - This is a bitvector that contains two bits for each
index 4bd20479ff790b8be66cfbb74a2f466d387aa606..9e98a976f03aa91c2e3e99a4d2f0827b010f1a50 100644 (file)
@@ -60,7 +60,7 @@ namespace {
 
   RegisterPass<TwoAddressInstructionPass>
   X("twoaddressinstruction", "Two-Address instruction pass");
-};
+}
 
 const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
 
index 1233cf4f0a0185f357bb75bca218dbf20c0c2f06..99bfd676c0504bbddf7a3c6a7edde4288db45900 100644 (file)
@@ -23,7 +23,7 @@ using namespace llvm;
 
 enum CompressionTypes {
   COMP_TYPE_NONE  = '0',
-  COMP_TYPE_BZIP2 = '2',
+  COMP_TYPE_BZIP2 = '2'
 };
 
 static int getdata(char*& buffer, size_t &size,
index 5160110bc2e2828bdece7fdbc5779222b35693f1..39c11cd7a666e27728d99a890a1a476ecc4a4a87 100644 (file)
@@ -42,4 +42,4 @@ namespace llvm {
 int IsInf (float f)  { return isinf (f); }
 int IsInf (double d) { return isinf (d); }
 
-}; // end namespace llvm;
+} // end namespace llvm;
index 3300b7b47f6ba557ffeae5b48dab8d113d7c331a..2ed2b284c7d19623f6a8fb31a170d40d6d37438c 100644 (file)
@@ -31,4 +31,4 @@ namespace llvm {
 int IsNAN (float f)  { return isnan (f); }
 int IsNAN (double d) { return isnan (d); }
 
-}; // end namespace llvm;
+} // end namespace llvm;
index 0a489781310275942a825f064dfefe9f60f88bca..7cf7dd37a4ac1f791f1ae9ba4864bab466835b28 100644 (file)
@@ -31,7 +31,7 @@ using namespace llvm;
 namespace ARMISD {
   enum {
     FIRST_NUMBER = ISD::BUILTIN_OP_END+ARM::INSTRUCTION_LIST_END,
-    RET_FLAG,
+    RET_FLAG
   };
 }
 
index 569fa74a8cfcdefb46289df9351f553660b54045..d6886fcc69ec0d8ec35fab81591538998c06ade3 100644 (file)
@@ -42,7 +42,7 @@ namespace llvm {
       CALL,
 
       /// DIVCALL - used for special library calls for div and rem
-      DivCall,
+      DivCall
 
     };
   }
index 59b97650858af413c6107cae6b4be0eed2b84b0b..c532f21f16107eac1d528e4a75c2309e605733a6 100644 (file)
@@ -23,7 +23,7 @@ namespace llvm {
       reloc_gprellow,
       reloc_gprelhigh,
       reloc_gpdist,
-      reloc_bsr,
+      reloc_bsr
     };
   }
 }
index 1e6c1e5c787531ac8cc48149c84662998e1fe320..850b4127ac97ff1c5073501348d1b7a2809f5914 100644 (file)
@@ -1748,7 +1748,7 @@ static SDOperand GeneratePerfectShuffle(unsigned PFEntry, SDOperand LHS,
     OP_VSPLTISW3,
     OP_VSLDOI4,
     OP_VSLDOI8,
-    OP_VSLDOI12,
+    OP_VSLDOI12
   };
   
   if (OpNum == OP_COPY) {
index 857d42b71b2b376fb1d07a6dbde0194e94bd15ab..25551fb6c29d957dde8968c39ea293027eaf139b 100644 (file)
@@ -44,7 +44,7 @@ enum {
   /// PPC970_Mask/Shift - This is a bitmask that selects the pipeline type that
   /// an instruction is issued to.
   PPC970_Shift = 3,
-  PPC970_Mask = 0x07 << PPC970_Shift,
+  PPC970_Mask = 0x07 << PPC970_Shift
 };
 enum PPC970_Unit {
   /// These are the various PPC970 execution unit pipelines.  Each instruction
@@ -56,7 +56,7 @@ enum PPC970_Unit {
   PPC970_CRU    = 4 << PPC970_Shift,   // Control Register Unit
   PPC970_VALU   = 5 << PPC970_Shift,   // Vector ALU
   PPC970_VPERM  = 6 << PPC970_Shift,   // Vector Permute Unit
-  PPC970_BRU    = 7 << PPC970_Shift,   // Branch Unit
+  PPC970_BRU    = 7 << PPC970_Shift    // Branch Unit
 };
 }
   
index a6d630efa2c9d6bea3af0a070d59924749c71807..6ee10d78b635e721f248ffc90a486fe3b40e7f40 100644 (file)
@@ -165,7 +165,7 @@ PPCJITInfo::getLazyResolverFunction(JITCompilerFn Fn) {
 void *PPCJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
   // If this is just a call to an external function, emit a branch instead of a
   // call.  The code is the same except for one bit of the last instruction.
-  if (Fn != PPC32CompilationCallback) {
+  if (Fn != (void*)PPC32CompilationCallback) {
     MCE.startFunctionStub(4*4);
     void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue();
     MCE.emitWordBE(0);
index 77c351980cfac21c2ed8950b48ad75d1439be9eb..20d747b06d5968e3131f1fc70843e88e457f0048 100644 (file)
@@ -50,7 +50,7 @@ namespace llvm {
       // relocated to point to a POINTER to the indicated global.  The low-16
       // bits of the instruction are rewritten with the low 16-bits of the
       // address of the pointer.
-      reloc_absolute_ptr_low,
+      reloc_absolute_ptr_low
     };
   }
 }
index 084bfe3987ffba9c3cc94d7933a90db798f0fcc2..c2ae18d9c4f4c4a7a47b90fcd0bc76bde7e2d04e 100644 (file)
@@ -75,7 +75,7 @@ namespace llvm {
       FCC_UGE = 12+16,  // Unordered or Greater or Equal
       FCC_LE  = 13+16,  // Less or Equal
       FCC_ULE = 14+16,  // Unordered or Less or Equal
-      FCC_O   = 15+16,  // Ordered
+      FCC_O   = 15+16   // Ordered
     };
   }
   
index 123b86aa294778f81ca6053f2b554461ac8f0cea..25f6e234a2f3f6b686e97ef05928332a6ffb4a52 100644 (file)
@@ -48,7 +48,7 @@ namespace SPISD {
     ITOF,        // Int to FP within a FP register.
 
     CALL,        // A call instruction.
-    RET_FLAG,    // Return with a flag operand.
+    RET_FLAG     // Return with a flag operand.
   };
 }
 
index 3dd8b8e8b3f4f025a376415c38776f214fbe0329..166793e2e04c57b59629952c67cf261b5216d2b8 100644 (file)
@@ -29,7 +29,7 @@ namespace SPII {
     Store = (1<<2),
     DelaySlot = (1<<3)
   };
-};
+}
 
 class SparcInstrInfo : public TargetInstrInfo {
   const SparcRegisterInfo RI;
index beda79d49b06fe556f1754a4bf0a216b82fac5e8..9940fcf3b1d6d05ff83dfe6d671025bdb26fe1bb 100644 (file)
@@ -40,4 +40,4 @@ SparcSubtarget::SparcSubtarget(const Module &M, const std::string &FS) {
   // Unless explicitly enabled, disable the V9 instructions.
   if (!EnableV9)
     IsV9 = false;
-};
+}
index bf70d12a6b803be8075422f1920f666cf3f72dcc..c9e92fa854019c552f3ed2b5c53e9abe78f11fc2 100644 (file)
@@ -28,7 +28,7 @@ namespace llvm {
   bool UnsafeFPMath;
   bool FiniteOnlyFPMathOption;
   Reloc::Model RelocationModel;
-};
+}
 namespace {
   cl::opt<bool, true> PrintCode("print-machineinstrs",
     cl::desc("Print generated machine code"),
@@ -70,7 +70,7 @@ namespace {
       clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
                  "Relocatable external references, non-relocatable code"),
       clEnumValEnd));
-};
+}
 
 //---------------------------------------------------------------------------
 // TargetMachine Class
index 50c42ec0406b0cc06c8cb222d03366553800dd12..b53748ab75def5d49c070640c78ff0fc54555b27 100644 (file)
@@ -47,7 +47,7 @@ namespace {
   struct X86ISelAddressMode {
     enum {
       RegBase,
-      FrameIndexBase,
+      FrameIndexBase
     } BaseType;
 
     struct {            // This is really a union, discriminated by BaseType!
index 9269daf9abf299b4b12d61650feed112aab05515..38aa227c9577dcf92504b6b92f7c66ac3d7141a2 100644 (file)
@@ -156,7 +156,7 @@ namespace llvm {
 
       /// PINSRW - Insert the lower 16-bits of a 32-bit value to a vector,
       /// corresponds to X86::PINSRW.
-      PINSRW,
+      PINSRW
     };
 
     // X86 specific condition code. These correspond to X86_*_COND in
index f3e1c28e4d88c0a33a29783eaf34d953548d9212..c0fa58debffc3952ae692bab45ac25d3a188e4a7 100644 (file)
@@ -35,7 +35,7 @@ namespace llvm {
 struct X86AddressMode {
   enum {
     RegBase,
-    FrameIndexBase,
+    FrameIndexBase
   } BaseType;
 
   union {
index d6dfae14e6b752efff55caba112845d7a9e9edc1..b49c351d68f55ad22236fd3a36284d0342e64bda 100644 (file)
@@ -162,7 +162,7 @@ namespace X86II {
     SpecialFP  = 7 << FPTypeShift,
 
     OpcodeShift   = 16,
-    OpcodeMask    = 0xFF << OpcodeShift,
+    OpcodeMask    = 0xFF << OpcodeShift
     // Bits 25 -> 31 are unused
   };
 }
index 3d1222128af58d101e8924605be0d97affff35ce..6f83651c1842dc40759a3e9cd3994ca5446feea6 100644 (file)
@@ -167,7 +167,7 @@ X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
 }
 
 void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
-  if (Fn != X86CompilationCallback) {
+  if (Fn != (void*)X86CompilationCallback) {
     MCE.startFunctionStub(5);
     MCE.emitByte(0xE9);
     MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4);
index 7a5f1a68844a5026f044330151d640e8e4c9804c..bc1efabc7abc345d3fb87c39ba262992c9ee977b 100644 (file)
@@ -25,7 +25,7 @@ namespace llvm {
 
       // reloc_absolute_word - Absolute relocation, just add the relocated value
       // to the value already in memory.
-      reloc_absolute_word = 1,
+      reloc_absolute_word = 1
     };
   }
 }
index 5918d7ee997bdac53af2a3cc6fb4118f5f9b5216..31c01ee886dd6546f23698ba69e3ae59388a5217 100644 (file)
@@ -162,7 +162,7 @@ namespace {
 
   RegisterOpt<ProfilerRS> X("insert-rs-profiling-framework",
                           "Insert random sampling instrumentation  framework");
-};
+}
 
 //Local utilities
 static void ReplacePhiPred(BasicBlock* btarget, 
index 304ce08f7b38c00cd89f71bc129d81411b805d3e..e07db00452394aafb9e374267ad5671ed943d989 100644 (file)
@@ -26,4 +26,4 @@ namespace llvm {
     void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
                                  GlobalValue *CounterArray);
   };
-};
+}
index 22a14fb14efaacc0bdd836b5c5ad5cca791f5530..d6e524e54ea19c4535b6d00124a0323606d44a84 100644 (file)
@@ -529,7 +529,7 @@ bool ConstantFP::isValueValidForType(const Type *Ty, double Val) {
   case Type::DoubleTyID:
     return true;          // This is the largest type...
   }
-};
+}
 
 //===----------------------------------------------------------------------===//
 //                      Factory Function Implementation
index 6f2ca5dd8164f12ac3e8f1239291980c1d8301cf..8826cd2a777dce8cc83bae9e0714609c26ad4836 100644 (file)
@@ -74,4 +74,4 @@ namespace {
 
   RegisterAnalysis<CallGraphPrinter> P2("print-callgraph",
                                         "Print Call Graph to 'dot' file");
-};
+}
index 484b3b57934e8d19289950859a2a1a146e7cd8d6..9bb93b5b83cdaf92dd230f06086e25b17e28c9fb 100644 (file)
@@ -27,7 +27,7 @@ struct ListReducer {
   enum TestResult {
     NoFailure,         // No failure of the predicate was detected
     KeepSuffix,        // The suffix alone satisfies the predicate
-    KeepPrefix,        // The prefix alone satisfies the predicate
+    KeepPrefix         // The prefix alone satisfies the predicate
   };
 
   virtual ~ListReducer() {}
index 00dcc39e9f1875b860f8580a715880af5437bc3a..fdcc9e6404fd168a125abee699991c2060b5a790 100644 (file)
@@ -80,7 +80,7 @@ enum ArchiveOperation {
   QuickAppend,      ///< Quickly append to end of archive
   ReplaceOrInsert,  ///< Replace or Insert members
   DisplayTable,     ///< Display the table of contents
-  Extract,          ///< Extract files back to file system
+  Extract           ///< Extract files back to file system
 };
 
 // Modifiers to follow operation to vary behavior
index 604e30a3d537250a9f3db4ad434952f31001dd4c..dae8f95f85e2583ae0d0ac6c18f4d6e46b527553 100644 (file)
@@ -63,7 +63,7 @@ namespace {
   bool MultipleFiles = false;
 
   std::string ToolName;
-};
+}
 
 char TypeCharForSymbol (GlobalValue &GV) {
   if (GV.isExternal ())                                     return 'U';
index 1100e3e46f8b848100d67d2cd2ae00c929a28550..3ff3e6032414c9568e397169160b3395757ca4ac 100644 (file)
@@ -65,7 +65,7 @@ namespace llvm {
         PREPROCESSES_FLAG    = 0x0002, ///< Does this action preprocess?
         TRANSLATES_FLAG      = 0x0004, ///< Does this action translate?
         OUTPUT_IS_ASM_FLAG   = 0x0008, ///< Action produces .ll files?
-        FLAGS_MASK           = 0x000F, ///< Union of all flags
+        FLAGS_MASK           = 0x000F  ///< Union of all flags
       };
 
       /// This type is the input list to the CompilerDriver. It provides
@@ -131,7 +131,7 @@ namespace llvm {
         EMIT_RAW_FLAG        = 0x0080, ///< Emit raw, unoptimized bytecode
         KEEP_TEMPS_FLAG      = 0x0100, ///< Don't delete temporary files
         STRIP_OUTPUT_FLAG    = 0x0200, ///< Strip symbols from linked output
-        DRIVER_FLAGS_MASK    = 0x03FF, ///< Union of the above flags
+        DRIVER_FLAGS_MASK    = 0x03FF  ///< Union of the above flags
       };
 
     /// @}
index 3e87fc1a58a746ff528d3f6a266c30662de38f3f..2d5c64e86522f1a52c43e020209bf5f9394d50fc 100644 (file)
@@ -102,7 +102,7 @@ enum ConfigLexerTokens {
   TRUETOK,           ///< A boolean true value (true/yes/on)
   VERBOSE_SUBST,     ///< The substitution item %verbose%
   VERSION_TOK,       ///< The name "version" (and variants)
-  WOPTS_SUBST,       ///< The %WOpts% substitution
+  WOPTS_SUBST        ///< The %WOpts% substitution
 };
 
 extern ConfigLexerTokens Configlex();
index ca21f4f64d24036d356dfd16a820a23e5054b219..34b9a17de189037e5dd08050fd685b0981e0c394 100644 (file)
@@ -64,7 +64,7 @@ handleSubstitution(llvm::ConfigLexerTokens token) {
   }
   YY_FATAL_ERROR("Substitition tokens not allowed in names" ); 
   return ERRORTOK;
-};
+}
 
 inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) {
   ConfigLexerState.StringVal = yytext;
index ca21f4f64d24036d356dfd16a820a23e5054b219..34b9a17de189037e5dd08050fd685b0981e0c394 100644 (file)
@@ -64,7 +64,7 @@ handleSubstitution(llvm::ConfigLexerTokens token) {
   }
   YY_FATAL_ERROR("Substitition tokens not allowed in names" ); 
   return ERRORTOK;
-};
+}
 
 inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) {
   ConfigLexerState.StringVal = yytext;
index 6f2ca5dd8164f12ac3e8f1239291980c1d8301cf..8826cd2a777dce8cc83bae9e0714609c26ad4836 100644 (file)
@@ -74,4 +74,4 @@ namespace {
 
   RegisterAnalysis<CallGraphPrinter> P2("print-callgraph",
                                         "Print Call Graph to 'dot' file");
-};
+}
index 386b05d43ce543d296093af84711a03d5f2e615b..803aecea9659b090b657d07696fa807f06f026f9 100644 (file)
@@ -460,7 +460,7 @@ enum {
   OP_VSPLTISW3,
   OP_VSLDOI4,
   OP_VSLDOI8,
-  OP_VSLDOI12,
+  OP_VSLDOI12
 };
 
 struct vmrghw : public Operator {
index 0c97fafc20bf7bfe2b4641c4820e2942efde546e..8206ea5b57b68bb22b6feba8ebb7ca19b2aefd8b 100644 (file)
@@ -37,7 +37,7 @@ void RegisterInfoEmitter::runEnums(std::ostream &OS) {
   OS << "  enum {\n    NoRegister,\n";
 
   for (unsigned i = 0, e = Registers.size(); i != e; ++i)
-    OS << "    " << Registers[i].getName() << ", \t// " << i+1 << "\n";
+    OS << "    " << Registers[i].getName() << (i != (e-1) ? ", \t// " : "  \t// ") << i+1 << "\n";
 
   OS << "  };\n";
   if (!Namespace.empty())