Add explicit keywords.
authorDan Gohman <gohman@apple.com>
Mon, 8 Oct 2007 15:08:41 +0000 (15:08 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 8 Oct 2007 15:08:41 +0000 (15:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42747 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/Archive.h
include/llvm/Bitcode/BitCodes.h
include/llvm/Bitcode/BitstreamWriter.h
include/llvm/Support/CommandLine.h
include/llvm/Target/SubtargetFeature.h
lib/VMCore/PassManager.cpp

index 39ad5eb63a6c70d58df4dfbf3be0d0cb7e84a181..6ddf4a4aca4172a17620a12cf79cd7b3c8ecaa84 100644 (file)
@@ -198,7 +198,7 @@ class ArchiveMember {
   private:
     /// Used internally by the Archive class to construct an ArchiveMember.
     /// The contents of the ArchiveMember are filled out by the Archive class.
-    ArchiveMember(Archive *PAR);
+    explicit ArchiveMember(Archive *PAR);
 
     // So Archive can construct an ArchiveMember
     friend class llvm::Archive;
@@ -461,7 +461,7 @@ class Archive {
   protected:
     /// @brief Construct an Archive for \p filename and optionally  map it
     /// into memory.
-    Archive(const sys::Path& filename);
+    explicit Archive(const sys::Path& filename);
 
     /// @param data The symbol table data to be parsed
     /// @param len  The length of the symbol table data
index 59d57e77f2855fc8ee3b52ceeea1adb196f0f46c..a959ef22296ea09105407449657f6123fef8a141 100644 (file)
@@ -91,8 +91,8 @@ public:
     Char6 = 4   // A 6-bit fixed field which maps to [a-zA-Z0-9._].
   };
     
-  BitCodeAbbrevOp(uint64_t V) :  Val(V), IsLiteral(true) {}
-  BitCodeAbbrevOp(Encoding E, uint64_t Data = 0)
+  explicit BitCodeAbbrevOp(uint64_t V) :  Val(V), IsLiteral(true) {}
+  explicit BitCodeAbbrevOp(Encoding E, uint64_t Data = 0)
     : Val(Data), IsLiteral(false), Enc(E) {}
   
   bool isLiteral() const { return IsLiteral; }
index 64598edbd562d02efe541670c20d96e2c76bd946..ef7d7e7ef4284939e032d1023295a86b97bdfbe0 100644 (file)
@@ -59,7 +59,7 @@ class BitstreamWriter {
   std::vector<BlockInfo> BlockInfoRecords;
   
 public:
-  BitstreamWriter(std::vector<unsigned char> &O) 
+  explicit BitstreamWriter(std::vector<unsigned char> &O) 
     : Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {}
 
   ~BitstreamWriter() {
index 23b7cf380e7c33f6c07e14a3bd652bf25b79499d..562ba04aa5091d0ca6badf107d356e52df16e315 100644 (file)
@@ -838,7 +838,7 @@ public:
 
   // One option...
   template<class M0t>
-  opt(const M0t &M0) : Option(Optional | NotHidden) {
+  explicit opt(const M0t &M0) : Option(Optional | NotHidden) {
     apply(M0, this);
     done();
   }
@@ -998,7 +998,7 @@ public:
 
   // One option...
   template<class M0t>
-  list(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
+  explicit list(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
     apply(M0, this);
     done();
   }
@@ -1184,7 +1184,7 @@ public:
 
   // One option...
   template<class M0t>
-  bits(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
+  explicit bits(const M0t &M0) : Option(ZeroOrMore | NotHidden) {
     apply(M0, this);
     done();
   }
@@ -1277,7 +1277,7 @@ public:
 
   // One option...
   template<class M0t>
-  alias(const M0t &M0) : Option(Optional | Hidden), AliasFor(0) {
+  explicit alias(const M0t &M0) : Option(Optional | Hidden), AliasFor(0) {
     apply(M0, this);
     done();
   }
@@ -1306,7 +1306,7 @@ public:
 // aliasfor - Modifier to set the option an alias aliases.
 struct aliasopt {
   Option &Opt;
-  aliasopt(Option &O) : Opt(O) {}
+  explicit aliasopt(Option &O) : Opt(O) {}
   void apply(alias &A) const { A.setAliasFor(Opt); }
 };
 
index e809fc0a2cc199ad6f898aff2f3eaf6740061a09..b0bb94193adbca3dfcc8922edaa7939cd40b9da4 100644 (file)
@@ -73,7 +73,7 @@ struct SubtargetInfoKV {
 class SubtargetFeatures {
   std::vector<std::string> Features;    // Subtarget features as a vector
 public:
-  SubtargetFeatures(const std::string &Initial = std::string());
+  explicit SubtargetFeatures(const std::string &Initial = std::string());
 
   /// Features string accessors.
   std::string getString() const;
index edcdf7ffe390adb963fa9247990481af6fbe7a73..af856ab034f8389d6170f2c324b81e5bb34ce040 100644 (file)
@@ -65,7 +65,7 @@ class VISIBILITY_HIDDEN BBPassManager : public PMDataManager,
 
 public:
   static char ID;
-  BBPassManager(int Depth) 
+  explicit BBPassManager(int Depth) 
     : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {}
 
   /// Execute all of the passes scheduled for execution.  Keep track of
@@ -121,7 +121,7 @@ class FunctionPassManagerImpl : public Pass,
                                 public PMTopLevelManager {
 public:
   static char ID;
-  FunctionPassManagerImpl(int Depth) : 
+  explicit FunctionPassManagerImpl(int Depth) : 
     Pass((intptr_t)&ID), PMDataManager(Depth), 
     PMTopLevelManager(TLM_Function) { }
 
@@ -185,7 +185,8 @@ class MPPassManager : public Pass, public PMDataManager {
  
 public:
   static char ID;
-  MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { }
+  explicit MPPassManager(int Depth) :
+    Pass((intptr_t)&ID), PMDataManager(Depth) { }
 
   // Delete on the fly managers.
   virtual ~MPPassManager() {
@@ -260,8 +261,9 @@ class PassManagerImpl : public Pass,
 
 public:
   static char ID;
-  PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth),
-                               PMTopLevelManager(TLM_Pass) { }
+  explicit PassManagerImpl(int Depth) :
+    Pass((intptr_t)&ID), PMDataManager(Depth),
+    PMTopLevelManager(TLM_Pass) { }
 
   /// add - Add a pass to the queue of passes to run.  This passes ownership of
   /// the Pass to the PassManager.  When the PassManager is destroyed, the pass