More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h
index 4914df7..6d6d94c 100644
--- a/include/llvm/Analysis/LoopPass.h
+++ b/include/llvm/Analysis/LoopPass.h
@@ -84,7 +84,7 @@
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 1500053..ec00fc1 100644
--- a/include/llvm/CodeGen/MachineConstantPool.h
+++ b/include/llvm/CodeGen/MachineConstantPool.h
@@ -114,7 +114,8 @@
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
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index a1aa50c..c22d399 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -76,7 +76,7 @@
SchedulingForRegPressure // Scheduling for lowest register pressure.
};
- TargetLowering(TargetMachine &TM);
+ explicit TargetLowering(TargetMachine &TM);
virtual ~TargetLowering();
TargetMachine &getTargetMachine() const { return TM; }
@@ -510,7 +510,7 @@
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 01f1aff..a1e0c05 100644
--- a/include/llvm/Transforms/IPO/InlinerPass.h
+++ b/include/llvm/Transforms/IPO/InlinerPass.h
@@ -26,7 +26,7 @@
/// 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 786b720..e28a2a5 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -31,7 +31,7 @@
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 e749375..9685943 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -33,7 +33,7 @@
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 8d6af41..ed22465 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/lib/Transforms/IPO/ExtractFunction.cpp
@@ -31,8 +31,8 @@
/// 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 7b5392c..7ca6cb1 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -47,8 +47,8 @@
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);
};
diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp
index 7b14ce0..80c1e1a 100644
--- a/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/lib/Transforms/IPO/LoopExtractor.cpp
@@ -37,7 +37,7 @@
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 @@
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) {}
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp
index c8f8926..aaecc2f 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -38,7 +38,7 @@
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 2969df3..ddc0007 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -40,8 +40,8 @@
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 64c60ba..5bea783 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -145,7 +145,7 @@
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 46a9153..3a10bd7 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -73,7 +73,7 @@
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 45bf562..52edcb6 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -48,7 +48,7 @@
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 7ce2479..edc4c8a 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -37,7 +37,7 @@
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 551ca7f..ba03635 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -76,8 +76,8 @@
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 1882695..317e84a 100644
--- a/lib/Transforms/Utils/LowerSelect.cpp
+++ b/lib/Transforms/Utils/LowerSelect.cpp
@@ -34,7 +34,7 @@
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 {