More explicit keywords.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2007-08-01 15:32:29 +00:00
parent a9f643432d
commit c2bbfc18e9
17 changed files with 24 additions and 23 deletions

View File

@ -84,7 +84,7 @@ class LPPassManager : public FunctionPass, public PMDataManager {
public: public:
static char ID; static char ID;
LPPassManager(int Depth); explicit LPPassManager(int Depth);
/// run - Execute all of the passes scheduled for execution. Keep track of /// 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. /// whether any of the passes modifies the module, and if so, return true.

View File

@ -114,7 +114,8 @@ class MachineConstantPool {
std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants. std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
public: public:
/// @brief The only constructor. /// @brief The only constructor.
MachineConstantPool(const TargetData *td) : TD(td), PoolAlignment(1) {} explicit MachineConstantPool(const TargetData *td)
: TD(td), PoolAlignment(1) {}
~MachineConstantPool(); ~MachineConstantPool();
/// getConstantPoolAlignment - Return the log2 of the alignment required by /// getConstantPoolAlignment - Return the log2 of the alignment required by

View File

@ -76,7 +76,7 @@ public:
SchedulingForRegPressure // Scheduling for lowest register pressure. SchedulingForRegPressure // Scheduling for lowest register pressure.
}; };
TargetLowering(TargetMachine &TM); explicit TargetLowering(TargetMachine &TM);
virtual ~TargetLowering(); virtual ~TargetLowering();
TargetMachine &getTargetMachine() const { return TM; } TargetMachine &getTargetMachine() const { return TM; }
@ -510,7 +510,7 @@ public:
SDOperand Old; SDOperand Old;
SDOperand New; SDOperand New;
TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {} explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
bool CombineTo(SDOperand O, SDOperand N) { bool CombineTo(SDOperand O, SDOperand N) {
Old = O; Old = O;

View File

@ -26,7 +26,7 @@ namespace llvm {
/// perform the inlining operations that does not depend on the policy. /// perform the inlining operations that does not depend on the policy.
/// ///
struct Inliner : public CallGraphSCCPass { struct Inliner : public CallGraphSCCPass {
Inliner(const void *ID); explicit Inliner(const void *ID);
/// getAnalysisUsage - For this class, we declare that we require and preserve /// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should /// the call graph. If the derived class implements this method, it should

View File

@ -31,7 +31,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
public: public:
static char ID; static char ID;
CGPassManager(int Depth) explicit CGPassManager(int Depth)
: ModulePass((intptr_t)&ID), PMDataManager(Depth) { } : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
/// run - Execute all of the passes scheduled for execution. Keep track of /// run - Execute all of the passes scheduled for execution. Keep track of

View File

@ -33,7 +33,7 @@ namespace {
std::string Filename; std::string Filename;
public: public:
static char ID; // Class identification, replacement for typeinfo 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) { : ModulePass((intptr_t)&ID), Filename(filename) {
if (filename.empty()) Filename = ProfileInfoFilename; if (filename.empty()) Filename = ProfileInfoFilename;
} }

View File

@ -31,8 +31,8 @@ namespace {
/// specified function. Otherwise, it deletes as much of the module as /// specified function. Otherwise, it deletes as much of the module as
/// possible, except for the function specified. /// possible, except for the function specified.
/// ///
FunctionExtractorPass(Function *F = 0, bool deleteFn = true, explicit FunctionExtractorPass(Function *F = 0, bool deleteFn = true,
bool relinkCallees = false) bool relinkCallees = false)
: ModulePass((intptr_t)&ID), Named(F), deleteFunc(deleteFn), : ModulePass((intptr_t)&ID), Named(F), deleteFunc(deleteFn),
reLink(relinkCallees) {} reLink(relinkCallees) {}

View File

@ -47,8 +47,8 @@ namespace {
bool DontInternalize; bool DontInternalize;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
InternalizePass(bool InternalizeEverything = true); explicit InternalizePass(bool InternalizeEverything = true);
InternalizePass(const std::vector <const char *>& exportList); explicit InternalizePass(const std::vector <const char *>& exportList);
void LoadFile(const char *Filename); void LoadFile(const char *Filename);
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);
}; };

View File

@ -37,7 +37,7 @@ namespace {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
unsigned NumLoops; unsigned NumLoops;
LoopExtractor(unsigned numLoops = ~0) explicit LoopExtractor(unsigned numLoops = ~0)
: FunctionPass((intptr_t)&ID), NumLoops(numLoops) {} : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
@ -151,7 +151,7 @@ namespace {
std::vector<BasicBlock*> BlocksToNotExtract; std::vector<BasicBlock*> BlocksToNotExtract;
public: public:
static char ID; // Pass identification, replacement for typeid 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) {} : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {}
BlockExtractorPass() : ModulePass((intptr_t)&ID) {} BlockExtractorPass() : ModulePass((intptr_t)&ID) {}

View File

@ -38,7 +38,7 @@ namespace {
bool OnlyDebugInfo; bool OnlyDebugInfo;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
StripSymbols(bool ODI = false) explicit StripSymbols(bool ODI = false)
: ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {}
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);

View File

@ -40,8 +40,8 @@ namespace {
const TargetLowering *TLI; const TargetLowering *TLI;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID), explicit CodeGenPrepare(const TargetLowering *tli = 0)
TLI(tli) {} : FunctionPass((intptr_t)&ID), TLI(tli) {}
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
private: private:

View File

@ -145,7 +145,7 @@ namespace {
public: public:
static char ID; // Pass ID, replacement for typeid 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) { LoopPass((intptr_t)&ID), TLI(tli) {
} }

View File

@ -73,7 +73,7 @@ namespace {
bool redoLoop; bool redoLoop;
public: public:
static char ID; // Pass ID, replacement for typeid 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) {} LoopPass((intptr_t)&ID), OptimizeForSize(Os), redoLoop(false) {}
bool runOnLoop(Loop *L, LPPassManager &LPM); bool runOnLoop(Loop *L, LPPassManager &LPM);

View File

@ -48,7 +48,7 @@ STATISTIC(NumGlobals, "Number of allocas copied from constant global");
namespace { namespace {
struct VISIBILITY_HIDDEN SROA : public FunctionPass { struct VISIBILITY_HIDDEN SROA : public FunctionPass {
static char ID; // Pass identification, replacement for typeid 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) if (T == -1)
SRThreshold = 128; SRThreshold = 128;
else else

View File

@ -37,7 +37,7 @@ namespace {
bool LowerMallocArgToInteger; bool LowerMallocArgToInteger;
public: public:
static char ID; // Pass ID, replacement for typeid 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), : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0),
LowerMallocArgToInteger(LowerToInt) {} LowerMallocArgToInteger(LowerToInt) {}

View File

@ -76,8 +76,8 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID), explicit LowerInvoke(const TargetLowering *tli = NULL)
TLI(tli) { } : FunctionPass((intptr_t)&ID), TLI(tli) { }
bool doInitialization(Module &M); bool doInitialization(Module &M);
bool runOnFunction(Function &F); bool runOnFunction(Function &F);

View File

@ -34,7 +34,7 @@ namespace {
bool OnlyFP; // Only lower FP select instructions? bool OnlyFP; // Only lower FP select instructions?
public: public:
static char ID; // Pass identification, replacement for typeid 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) {} OnlyFP(onlyfp) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {