More explicit keywords.
authorDan Gohman <gohman@apple.com>
Wed, 1 Aug 2007 15:32:29 +0000 (15:32 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 1 Aug 2007 15:32:29 +0000 (15:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8

17 files changed:
include/llvm/Analysis/LoopPass.h
include/llvm/CodeGen/MachineConstantPool.h
include/llvm/Target/TargetLowering.h
include/llvm/Transforms/IPO/InlinerPass.h
lib/Analysis/IPA/CallGraphSCCPass.cpp
lib/Analysis/ProfileInfoLoaderPass.cpp
lib/Transforms/IPO/ExtractFunction.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/LoopExtractor.cpp
lib/Transforms/IPO/StripSymbols.cpp
lib/Transforms/Scalar/CodeGenPrepare.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/Transforms/Utils/LowerInvoke.cpp
lib/Transforms/Utils/LowerSelect.cpp

index 4914df78e444cbca91dd8143d3c494d2a8b85858..6d6d94c71d35f1bc9f85d773ee1cb589f528da93 100644 (file)
@@ -84,7 +84,7 @@ class LPPassManager : public FunctionPass, public PMDataManager {
 
 public:
   static char ID;
-  LPPassManager(int Depth);
+  explicit LPPassManager(int Depth);
 
   /// run - Execute all of the passes scheduled for execution.  Keep track of
   /// whether any of the passes modifies the module, and if so, return true.
index 1500053a125d3d9992aa28c6faaaaa6a31a0a642..ec00fc115d1d10c1ec5082dc9a5fd61e3cbc11d5 100644 (file)
@@ -114,7 +114,8 @@ class MachineConstantPool {
   std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
 public:
   /// @brief The only constructor.
-  MachineConstantPool(const TargetData *td) : TD(td), PoolAlignment(1) {}
+  explicit MachineConstantPool(const TargetData *td)
+    : TD(td), PoolAlignment(1) {}
   ~MachineConstantPool();
     
   /// getConstantPoolAlignment - Return the log2 of the alignment required by
index a1aa50c9c793fc5ec79077c4012f043b23cf2429..c22d3995c58a5f101a03953d053acf5954ab83ce 100644 (file)
@@ -76,7 +76,7 @@ public:
     SchedulingForRegPressure       // Scheduling for lowest register pressure.
   };
 
-  TargetLowering(TargetMachine &TM);
+  explicit TargetLowering(TargetMachine &TM);
   virtual ~TargetLowering();
 
   TargetMachine &getTargetMachine() const { return TM; }
@@ -510,7 +510,7 @@ public:
     SDOperand Old;
     SDOperand New;
 
-    TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
+    explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
     
     bool CombineTo(SDOperand O, SDOperand N) { 
       Old = O; 
index 01f1affde9090dfba5a6ec4d67b33a7c9e869f34..a1e0c055a2e67046184b52003240e53a2773a6ef 100644 (file)
@@ -26,7 +26,7 @@ namespace llvm {
 /// perform the inlining operations that does not depend on the policy.
 ///
 struct Inliner : public CallGraphSCCPass {
-  Inliner(const void *ID);
+  explicit Inliner(const void *ID);
 
   /// getAnalysisUsage - For this class, we declare that we require and preserve
   /// the call graph.  If the derived class implements this method, it should
index 786b720db7aef48b0bb4fbb5d477b3067074724c..e28a2a55d5140167c6a0bfc6f25e088b9a3a0429 100644 (file)
@@ -31,7 +31,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
 
 public:
   static char ID;
-  CGPassManager(int Depth) 
+  explicit CGPassManager(int Depth) 
     : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
 
   /// run - Execute all of the passes scheduled for execution.  Keep track of
index e749375723391d544f7ac95bf188c4c3d399c799..9685943e517619739cd9d566f6af803179500e4d 100644 (file)
@@ -33,7 +33,7 @@ namespace {
     std::string Filename;
   public:
     static char ID; // Class identification, replacement for typeinfo
-    LoaderPass(const std::string &filename = "")
+    explicit LoaderPass(const std::string &filename = "")
       : ModulePass((intptr_t)&ID), Filename(filename) {
       if (filename.empty()) Filename = ProfileInfoFilename;
     }
index 8d6af4176e6185585fbd370bbc51bdfd9e7c9506..ed22465f890b42296985b9fbe997240a42702341 100644 (file)
@@ -31,8 +31,8 @@ namespace {
     /// specified function. Otherwise, it deletes as much of the module as
     /// possible, except for the function specified.
     ///
-    FunctionExtractorPass(Function *F = 0, bool deleteFn = true,
-                          bool relinkCallees = false)
+    explicit FunctionExtractorPass(Function *F = 0, bool deleteFn = true,
+                                   bool relinkCallees = false)
       : ModulePass((intptr_t)&ID), Named(F), deleteFunc(deleteFn), 
       reLink(relinkCallees) {}
 
index 7b5392c0d9b12ee255c40980434050032acd3e9f..7ca6cb1dfa9467b6a5138b49a467ce10abc4d381 100644 (file)
@@ -47,8 +47,8 @@ namespace {
     bool DontInternalize;
   public:
     static char ID; // Pass identification, replacement for typeid
-    InternalizePass(bool InternalizeEverything = true);
-    InternalizePass(const std::vector <const char *>& exportList);
+    explicit InternalizePass(bool InternalizeEverything = true);
+    explicit InternalizePass(const std::vector <const char *>& exportList);
     void LoadFile(const char *Filename);
     virtual bool runOnModule(Module &M);
   };
index 7b14ce04deaef330061bd84d26ee240ad693483f..80c1e1a287db71177bdb7e52082240a996b25912 100644 (file)
@@ -37,7 +37,7 @@ namespace {
     static char ID; // Pass identification, replacement for typeid
     unsigned NumLoops;
 
-    LoopExtractor(unsigned numLoops = ~0) 
+    explicit LoopExtractor(unsigned numLoops = ~0) 
       : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {}
 
     virtual bool runOnFunction(Function &F);
@@ -151,7 +151,7 @@ namespace {
     std::vector<BasicBlock*> BlocksToNotExtract;
   public:
     static char ID; // Pass identification, replacement for typeid
-    BlockExtractorPass(std::vector<BasicBlock*> &B) 
+    explicit BlockExtractorPass(std::vector<BasicBlock*> &B) 
       : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {}
     BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
 
index c8f892604ea8e31e6b8ae60a4f9db7591443596e..aaecc2f252692ca837e3df9253174edd6115348d 100644 (file)
@@ -38,7 +38,7 @@ namespace {
     bool OnlyDebugInfo;
   public:
     static char ID; // Pass identification, replacement for typeid
-    StripSymbols(bool ODI = false) 
+    explicit StripSymbols(bool ODI = false) 
       : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {}
 
     virtual bool runOnModule(Module &M);
index 2969df38a696c61e5958a5c1c5107bcf2e53a03b..ddc0007c00bc6236a38d85b97c0268831799214f 100644 (file)
@@ -40,8 +40,8 @@ namespace {
     const TargetLowering *TLI;
   public:
     static char ID; // Pass identification, replacement for typeid
-    CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID),
-      TLI(tli) {}
+    explicit CodeGenPrepare(const TargetLowering *tli = 0)
+      : FunctionPass((intptr_t)&ID), TLI(tli) {}
     bool runOnFunction(Function &F);
     
   private:
index 64c60ba2e6398ba39001537e4d0b281bcd33814e..5bea783ff613ce358c319220fffa748c276be5ab 100644 (file)
@@ -145,7 +145,7 @@ namespace {
 
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopStrengthReduce(const TargetLowering *tli = NULL) : 
+    explicit LoopStrengthReduce(const TargetLowering *tli = NULL) : 
       LoopPass((intptr_t)&ID), TLI(tli) {
     }
 
index 46a91536dec0bc920348261086fac32670183bdf..3a10bd7ae5ef186098e956fa079ffad226d7cc51 100644 (file)
@@ -73,7 +73,7 @@ namespace {
     bool redoLoop;
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopUnswitch(bool Os = false) : 
+    explicit LoopUnswitch(bool Os = false) : 
       LoopPass((intptr_t)&ID), OptimizeForSize(Os), redoLoop(false) {}
 
     bool runOnLoop(Loop *L, LPPassManager &LPM);
index 45bf562f4a69b6c1fd559dc198087a51e619c649..52edcb67af1e8c3b57d3734dfb10bbfded614f90 100644 (file)
@@ -48,7 +48,7 @@ STATISTIC(NumGlobals,   "Number of allocas copied from constant global");
 namespace {
   struct VISIBILITY_HIDDEN SROA : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    SROA(signed T = -1) : FunctionPass((intptr_t)&ID) {
+    explicit SROA(signed T = -1) : FunctionPass((intptr_t)&ID) {
       if (T == -1)
         SRThreshold = 128;
       else
index 7ce247909c5379c42e54445f19d06a5365df3f5c..edc4c8a96f893bc647d7a74c235f6316b8b81e0e 100644 (file)
@@ -37,7 +37,7 @@ namespace {
     bool LowerMallocArgToInteger;
   public:
     static char ID; // Pass ID, replacement for typeid
-    LowerAllocations(bool LowerToInt = false)
+    explicit LowerAllocations(bool LowerToInt = false)
       : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0), 
         LowerMallocArgToInteger(LowerToInt) {}
 
index 551ca7fcbda8e77f0e32472f955200c0cd1e0f09..ba0363594b0561d697df93509793b0fd4943a487 100644 (file)
@@ -76,8 +76,8 @@ namespace {
     
   public:
     static char ID; // Pass identification, replacement for typeid
-    LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID),
-      TLI(tli) { }
+    explicit LowerInvoke(const TargetLowering *tli = NULL)
+      : FunctionPass((intptr_t)&ID), TLI(tli) { }
     bool doInitialization(Module &M);
     bool runOnFunction(Function &F);
  
index 1882695d0705e23249f81fead08a23b60f8ca1c3..317e84aa96f345e146c0668d86df67a0df4674d7 100644 (file)
@@ -34,7 +34,7 @@ namespace {
     bool OnlyFP;   // Only lower FP select instructions?
   public:
     static char ID; // Pass identification, replacement for typeid
-    LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID), 
+    explicit LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID), 
       OnlyFP(onlyfp) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {