Add explicit keywords, and fix a minor typo that they uncovered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2007-12-14 15:41:34 +00:00
parent 064a57a77d
commit ded2b0d0fb
8 changed files with 11 additions and 10 deletions

View File

@ -389,7 +389,7 @@ private:
template<typename ValueTy> template<typename ValueTy>
class StringMapIterator : public StringMapConstIterator<ValueTy> { class StringMapIterator : public StringMapConstIterator<ValueTy> {
public: public:
StringMapIterator(StringMapImpl::ItemBucket *Bucket, explicit StringMapIterator(StringMapImpl::ItemBucket *Bucket,
bool NoAdvance = false) bool NoAdvance = false)
: StringMapConstIterator<ValueTy>(Bucket, NoAdvance) { : StringMapConstIterator<ValueTy>(Bucket, NoAdvance) {
} }

View File

@ -248,7 +248,7 @@ public:
} }
protected: protected:
ExecutionEngine(ModuleProvider *P); explicit ExecutionEngine(ModuleProvider *P);
void emitGlobals(); void emitGlobals();

View File

@ -34,7 +34,7 @@ struct GenericValue {
APInt IntVal; // also used for long doubles APInt IntVal; // also used for long doubles
GenericValue() : DoubleVal(0.0), IntVal(1,0) {} GenericValue() : DoubleVal(0.0), IntVal(1,0) {}
GenericValue(void *V) : PointerVal(V), IntVal(1,0) { } explicit GenericValue(void *V) : PointerVal(V), IntVal(1,0) { }
}; };
inline GenericValue PTOGV(void *P) { return GenericValue(P); } inline GenericValue PTOGV(void *P) { return GenericValue(P); }

View File

@ -246,7 +246,7 @@ namespace {
// Used for work list prioritization. // Used for work list prioritization.
unsigned Timestamp; unsigned Timestamp;
Node(bool direct = true) : explicit Node(bool direct = true) :
Val(0), Edges(0), PointsTo(0), OldPointsTo(0), Val(0), Edges(0), PointsTo(0), OldPointsTo(0),
PointerEquivLabel(0), LocationEquivLabel(0), PredEdges(0), PointerEquivLabel(0), LocationEquivLabel(0), PredEdges(0),
ImplicitPredEdges(0), PointedToBy(0), NumInEdges(0), ImplicitPredEdges(0), PointedToBy(0), NumInEdges(0),

View File

@ -30,7 +30,7 @@ namespace {
std::ostream &OS; std::ostream &OS;
public: public:
Printer(std::ostream &OS = *cerr); explicit Printer(std::ostream &OS = *cerr);
const char *getPassName() const; const char *getPassName() const;
void getAnalysisUsage(AnalysisUsage &AU) const; void getAnalysisUsage(AnalysisUsage &AU) const;

View File

@ -72,7 +72,7 @@ namespace llvm {
std::vector<unsigned char> *OutBuffer; std::vector<unsigned char> *OutBuffer;
size_t FnStart; size_t FnStart;
public: public:
ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {} explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {}
void startFunction(MachineFunction &F); void startFunction(MachineFunction &F);
bool finishFunction(MachineFunction &F); bool finishFunction(MachineFunction &F);

View File

@ -48,7 +48,7 @@ namespace llvm {
/// ///
struct CopyRecSort : public std::binary_function<CopyRec,CopyRec,bool> { struct CopyRecSort : public std::binary_function<CopyRec,CopyRec,bool> {
JoinPriorityQueue<CopyRecSort> *JPQ; JoinPriorityQueue<CopyRecSort> *JPQ;
CopyRecSort(JoinPriorityQueue<CopyRecSort> *jpq) : JPQ(jpq) {} explicit CopyRecSort(JoinPriorityQueue<CopyRecSort> *jpq) : JPQ(jpq) {}
CopyRecSort(const CopyRecSort &RHS) : JPQ(RHS.JPQ) {} CopyRecSort(const CopyRecSort &RHS) : JPQ(RHS.JPQ) {}
bool operator()(CopyRec left, CopyRec right) const; bool operator()(CopyRec left, CopyRec right) const;
}; };
@ -61,7 +61,8 @@ namespace llvm {
std::priority_queue<CopyRec, std::vector<CopyRec>, SF> Queue; std::priority_queue<CopyRec, std::vector<CopyRec>, SF> Queue;
public: public:
JoinPriorityQueue(SimpleRegisterCoalescing *rc) : Rc(rc), Queue(SF(this)) {} explicit JoinPriorityQueue(SimpleRegisterCoalescing *rc)
: Rc(rc), Queue(SF(this)) {}
bool empty() const { return Queue.empty(); } bool empty() const { return Queue.empty(); }
void push(CopyRec R) { Queue.push(R); } void push(CopyRec R) { Queue.push(R); }

View File

@ -653,7 +653,7 @@ GenericValue lle_X_fwrite(FunctionType *FT, const vector<GenericValue> &Args) {
// char *fgets(char *s, int n, FILE *stream); // char *fgets(char *s, int n, FILE *stream);
GenericValue lle_X_fgets(FunctionType *FT, const vector<GenericValue> &Args) { GenericValue lle_X_fgets(FunctionType *FT, const vector<GenericValue> &Args) {
assert(Args.size() == 3); assert(Args.size() == 3);
return GVTOP(fgets((char*)GVTOP(Args[0]), Args[1].IntVal.getZExtValue(), return PTOGV(fgets((char*)GVTOP(Args[0]), Args[1].IntVal.getZExtValue(),
getFILE(GVTOP(Args[2])))); getFILE(GVTOP(Args[2]))));
} }