diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h index 4914df78e44..6d6d94c71d3 100644 --- a/include/llvm/Analysis/LoopPass.h +++ b/include/llvm/Analysis/LoopPass.h @@ -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. diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h index 1500053a125..ec00fc115d1 100644 --- a/include/llvm/CodeGen/MachineConstantPool.h +++ b/include/llvm/CodeGen/MachineConstantPool.h @@ -114,7 +114,8 @@ class MachineConstantPool { std::vector 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 diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index a1aa50c9c79..c22d3995c58 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -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; diff --git a/include/llvm/Transforms/IPO/InlinerPass.h b/include/llvm/Transforms/IPO/InlinerPass.h index 01f1affde90..a1e0c055a2e 100644 --- a/include/llvm/Transforms/IPO/InlinerPass.h +++ b/include/llvm/Transforms/IPO/InlinerPass.h @@ -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 diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index 786b720db7a..e28a2a55d51 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -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 diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp index e7493757233..9685943e517 100644 --- a/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -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; } diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp index 8d6af4176e6..ed22465f890 100644 --- a/lib/Transforms/IPO/ExtractFunction.cpp +++ b/lib/Transforms/IPO/ExtractFunction.cpp @@ -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) {} diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 7b5392c0d9b..7ca6cb1dfa9 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -47,8 +47,8 @@ namespace { bool DontInternalize; public: static char ID; // Pass identification, replacement for typeid - InternalizePass(bool InternalizeEverything = true); - InternalizePass(const std::vector & exportList); + explicit InternalizePass(bool InternalizeEverything = true); + explicit InternalizePass(const std::vector & exportList); void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp index 7b14ce04dea..80c1e1a287d 100644 --- a/lib/Transforms/IPO/LoopExtractor.cpp +++ b/lib/Transforms/IPO/LoopExtractor.cpp @@ -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 BlocksToNotExtract; public: static char ID; // Pass identification, replacement for typeid - BlockExtractorPass(std::vector &B) + explicit BlockExtractorPass(std::vector &B) : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {} BlockExtractorPass() : ModulePass((intptr_t)&ID) {} diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index c8f892604ea..aaecc2f2526 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -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); diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 2969df38a69..ddc0007c00b 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -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: diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 64c60ba2e63..5bea783ff61 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -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) { } diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 46a91536dec..3a10bd7ae5e 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -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); diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 45bf562f4a6..52edcb67af1 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -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 diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 7ce247909c5..edc4c8a96f8 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -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) {} diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 551ca7fcbda..ba0363594b0 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -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); diff --git a/lib/Transforms/Utils/LowerSelect.cpp b/lib/Transforms/Utils/LowerSelect.cpp index 1882695d070..317e84aa96f 100644 --- a/lib/Transforms/Utils/LowerSelect.cpp +++ b/lib/Transforms/Utils/LowerSelect.cpp @@ -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 {