Add explicit keywords.
authorDan Gohman <gohman@apple.com>
Mon, 7 Jul 2008 18:00:37 +0000 (18:00 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 7 Jul 2008 18:00:37 +0000 (18:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/llvm/ADT/FoldingSet.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Support/Timer.h
include/llvm/Transforms/Utils/BasicInliner.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/CellSPU/SPUISelDAGToDAG.cpp
lib/Target/IA64/IA64ISelDAGToDAG.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/PIC16/PIC16ISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/VMCore/LeakDetector.cpp
lib/VMCore/Type.cpp
utils/TableGen/Record.h

index cce1eec1848f85028413040fc841f1f10aa63e07..7629301066e39bc894bac0ba7eae0726f078e8d1 100644 (file)
@@ -317,7 +317,7 @@ public:
 template<class T>
 class FoldingSetIterator : public FoldingSetIteratorImpl {
 public:
-  FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {}
+  explicit FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {}
   
   T &operator*() const {
     return *static_cast<T*>(NodePtr);
@@ -345,7 +345,7 @@ class FoldingSetBucketIteratorImpl {
 protected:
   void *Ptr;
 
-  FoldingSetBucketIteratorImpl(void **Bucket);
+  explicit FoldingSetBucketIteratorImpl(void **Bucket);
   
   FoldingSetBucketIteratorImpl(void **Bucket, bool)
     : Ptr(reinterpret_cast<void*>(Bucket)) {}
@@ -369,7 +369,7 @@ public:
 template<class T>
 class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
 public:
-  FoldingSetBucketIterator(void **Bucket) : 
+  explicit FoldingSetBucketIterator(void **Bucket) : 
     FoldingSetBucketIteratorImpl(Bucket) {}
   
   FoldingSetBucketIterator(void **Bucket, bool) : 
@@ -394,7 +394,7 @@ template <typename T>
 class FoldingSetNodeWrapper : public FoldingSetNode {
   T data;
 public:
-  FoldingSetNodeWrapper(const T& x) : data(x) {}
+  explicit FoldingSetNodeWrapper(const T& x) : data(x) {}
   virtual ~FoldingSetNodeWrapper() {}
   
   template<typename A1>
index dff1624a5a0a4bb1b3d16bdaf62e038ff1ad40d5..ff2c3caf5b06bc89cd910a7da2b0723f8ead5dae 100644 (file)
@@ -611,7 +611,7 @@ public:
   
 private:
   friend class LoopInfoBase<BlockT>;
-  LoopBase(BlockT *BB) : ParentLoop(0) {
+  explicit LoopBase(BlockT *BB) : ParentLoop(0) {
     Blocks.push_back(BB);
   }
 };
index 3d3a334d10d386c20b9ef1a0fc192f8dabc0356b..4164ddc891a7ac34a75b495d4db2e4905a9e52be 100644 (file)
@@ -44,7 +44,7 @@ class Timer {
   bool Started;          // Has this time variable ever been started?
   TimerGroup *TG;        // The TimerGroup this Timer is in.
 public:
-  Timer(const std::string &N);
+  explicit Timer(const std::string &N);
   Timer(const std::string &N, TimerGroup &tg);
   Timer(const Timer &T);
   ~Timer();
@@ -116,7 +116,7 @@ class TimeRegion {
   Timer &T;
   TimeRegion(const TimeRegion &); // DO NOT IMPLEMENT
 public:
-  TimeRegion(Timer &t) : T(t) {
+  explicit TimeRegion(Timer &t) : T(t) {
     T.startTimer();
   }
   ~TimeRegion() {
@@ -131,7 +131,7 @@ public:
 /// is primarily used for debugging and for hunting performance problems.
 ///
 struct NamedRegionTimer : public TimeRegion {
-  NamedRegionTimer(const std::string &Name);
+  explicit NamedRegionTimer(const std::string &Name);
 };
 
 
@@ -145,7 +145,7 @@ class TimerGroup {
   unsigned NumTimers;
   std::vector<Timer> TimersToPrint;
 public:
-  TimerGroup(const std::string &name) : Name(name), NumTimers(0) {}
+  explicit TimerGroup(const std::string &name) : Name(name), NumTimers(0) {}
   ~TimerGroup() {
     assert(NumTimers == 0 &&
            "TimerGroup destroyed before all contained timers!");
index e2070f93faff36c5079598825518a4b633fa18fa..6a570552d64053d4fd6f25d03354ca8b41a36b30 100644 (file)
@@ -30,7 +30,7 @@ namespace llvm {
   class BasicInliner {
   public:
     
-    BasicInliner(TargetData *T = NULL);
+    explicit BasicInliner(TargetData *T = NULL);
     ~BasicInliner();
 
     /// addFunction - Add function into the list of functions to process.
index 5cf637e0468eba85461a519734cb2a6aa5da158f..a3f268f63c81545545e24d75667208991d750305 100644 (file)
@@ -122,8 +122,7 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
   }
 
 public:
-
-  SelectionDAGLegalize(SelectionDAG &DAG);
+  explicit SelectionDAGLegalize(SelectionDAG &DAG);
 
   /// getTypeAction - Return how we should legalize values of this type, either
   /// it is already legal or we need to expand it into multiple registers of
index de43d6cde26d87834a028296511892bf1b282320..c2089c63e6ded4bfc253024a5b8a5cf8c971b7f7 100644 (file)
@@ -284,7 +284,7 @@ namespace {
     public SelectionDAG::DAGUpdateListener {
     DAGTypeLegalizer &DTL;
   public:
-    NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
+    explicit NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
 
     virtual void NodeDeleted(SDNode *N, SDNode *E) {
       assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
index 34f6cb923d54a7bbdf71b075f11b965a9310149c..37d647b95eebbf99bdaf2453c322d68b89df8603 100644 (file)
@@ -44,7 +44,7 @@ class ARMDAGToDAGISel : public SelectionDAGISel {
   const ARMSubtarget *Subtarget;
 
 public:
-  ARMDAGToDAGISel(ARMTargetMachine &TM)
+  explicit ARMDAGToDAGISel(ARMTargetMachine &TM)
     : SelectionDAGISel(Lowering), Lowering(TM),
     Subtarget(&TM.getSubtarget<ARMSubtarget>()) {
   }
index 6bc69ee2181a279a847a0427b9cbf876a8a471d0..a672b132ce58039f305779ac81641fb0f06e7651 100644 (file)
@@ -227,7 +227,7 @@ class SPUDAGToDAGISel :
   unsigned GlobalBaseReg;
 
 public:
-  SPUDAGToDAGISel(SPUTargetMachine &tm) :
+  explicit SPUDAGToDAGISel(SPUTargetMachine &tm) :
     SelectionDAGISel(*tm.getTargetLowering()),
     TM(tm),
     SPUtli(*tm.getTargetLowering())
index dcd1fe2fcc738395a9ebf71c9d7828665da75f8b..85c10fe64252994a679487fb35d13a78ca5e932b 100644 (file)
@@ -40,7 +40,7 @@ namespace {
     IA64TargetLowering IA64Lowering;
     unsigned GlobalBaseReg;
   public:
-    IA64DAGToDAGISel(IA64TargetMachine &TM)
+    explicit IA64DAGToDAGISel(IA64TargetMachine &TM)
       : SelectionDAGISel(IA64Lowering), IA64Lowering(*TM.getTargetLowering()) {}
     
     virtual bool runOnFunction(Function &Fn) {
index 4822e0159a0ebb04feb0b2e97ffa48e787393046..c5d3abde19ea5b0d88a8f01bcdbf9b41abe9f077 100644 (file)
@@ -61,7 +61,8 @@ class VISIBILITY_HIDDEN MipsDAGToDAGISel : public SelectionDAGISel {
   const MipsSubtarget &Subtarget;
  
 public:
-  MipsDAGToDAGISel(MipsTargetMachine &tm) : SelectionDAGISel(MipsLowering),
+  explicit MipsDAGToDAGISel(MipsTargetMachine &tm) :
+  SelectionDAGISel(MipsLowering),
   TM(tm), MipsLowering(*TM.getTargetLowering()), 
   Subtarget(tm.getSubtarget<MipsSubtarget>()) {}
   
index 325e71e7bcf68e5a0fd4d5bf82049bc3abb4adf6..402566fb3bef444886bef10bb4b4e17c36456b1d 100644 (file)
@@ -57,7 +57,7 @@ class VISIBILITY_HIDDEN PIC16DAGToDAGISel : public SelectionDAGISel {
   PIC16TargetLowering PIC16Lowering;
 
 public:
-  PIC16DAGToDAGISel(PIC16TargetMachine &tm) : 
+  explicit PIC16DAGToDAGISel(PIC16TargetMachine &tm) : 
         SelectionDAGISel(PIC16Lowering),
         TM(tm), PIC16Lowering(*TM.getTargetLowering()) {}
   
index 1dea2eec4b95550ff653c75bb91db9dbc94528ed..09563c4c2af0e28d9ba5a8a423ce6578393b31b2 100644 (file)
@@ -45,7 +45,7 @@ namespace {
     const PPCSubtarget &PPCSubTarget;
     unsigned GlobalBaseReg;
   public:
-    PPCDAGToDAGISel(PPCTargetMachine &tm)
+    explicit PPCDAGToDAGISel(PPCTargetMachine &tm)
       : SelectionDAGISel(PPCLowering), TM(tm),
         PPCLowering(*TM.getTargetLowering()),
         PPCSubTarget(*TM.getSubtargetImpl()) {}
index 50690ca300f1850e49ef7fe341fafdd1b40e7e53..df07d510fd0a4ab4c4f8c30a6c77b7f80002d941 100644 (file)
@@ -35,7 +35,7 @@ class SparcDAGToDAGISel : public SelectionDAGISel {
   /// make the right decision when generating code for different targets.
   const SparcSubtarget &Subtarget;
 public:
-  SparcDAGToDAGISel(TargetMachine &TM)
+  explicit SparcDAGToDAGISel(TargetMachine &TM)
     : SelectionDAGISel(Lowering), Lowering(TM),
       Subtarget(TM.getSubtarget<SparcSubtarget>()) {
   }
index 9f3584e25a22d9650b685dc99709533715797646..4ad75b737334e072aeaea3046d0f23ae16b77a69 100644 (file)
@@ -31,7 +31,7 @@ namespace {
 
   template <typename T>
   struct VISIBILITY_HIDDEN LeakDetectorImpl {
-    LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { }
+    explicit LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { }
 
     // Because the most common usage pattern, by far, is to add a
     // garbage object, then remove it immediately, we optimize this
index f1721306885f9bf541ef09d97e4ec1bd682f837b..90258edbda2a3393142da082025f427ea194e520 100644 (file)
@@ -431,7 +431,7 @@ const Type *Type::LabelTy      = new Type(Type::LabelTyID);
 
 namespace {
   struct BuiltinIntegerType : public IntegerType {
-    BuiltinIntegerType(unsigned W) : IntegerType(W) {}
+    explicit BuiltinIntegerType(unsigned W) : IntegerType(W) {}
   };
 }
 const IntegerType *Type::Int1Ty  = new BuiltinIntegerType(1);
index 83d358ad2ce746ed47cf96dba7e3ba6a09d72ba9..c36d808213b9590f865398ebc346aa99de70b782 100644 (file)
@@ -151,7 +151,7 @@ public:
 class BitsRecTy : public RecTy {
   unsigned Size;
 public:
-  BitsRecTy(unsigned Sz) : Size(Sz) {}
+  explicit BitsRecTy(unsigned Sz) : Size(Sz) {}
 
   unsigned getNumBits() const { return Size; }
 
@@ -268,7 +268,7 @@ public:
 class ListRecTy : public RecTy {
   RecTy *Ty;
 public:
-  ListRecTy(RecTy *T) : Ty(T) {}
+  explicit ListRecTy(RecTy *T) : Ty(T) {}
 
   RecTy *getElementType() const { return Ty; }
 
@@ -381,7 +381,7 @@ public:
 class RecordRecTy : public RecTy {
   Record *Rec;
 public:
-  RecordRecTy(Record *R) : Rec(R) {}
+  explicit RecordRecTy(Record *R) : Rec(R) {}
 
   Record *getRecord() const { return Rec; }
 
@@ -966,7 +966,7 @@ class Record {
   std::vector<Record*> SuperClasses;
 public:
 
-  Record(const std::string &N) : Name(N) {}
+  explicit Record(const std::string &N) : Name(N) {}
   ~Record() {}
 
   const std::string &getName() const { return Name; }