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,8 +389,8 @@ private:
template<typename ValueTy>
class StringMapIterator : public StringMapConstIterator<ValueTy> {
public:
StringMapIterator(StringMapImpl::ItemBucket *Bucket,
bool NoAdvance = false)
explicit StringMapIterator(StringMapImpl::ItemBucket *Bucket,
bool NoAdvance = false)
: StringMapConstIterator<ValueTy>(Bucket, NoAdvance) {
}
StringMapEntry<ValueTy> &operator*() const {

View File

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

View File

@ -34,7 +34,7 @@ struct GenericValue {
APInt IntVal; // also used for long doubles
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); }

View File

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

View File

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

View File

@ -72,7 +72,7 @@ namespace llvm {
std::vector<unsigned char> *OutBuffer;
size_t FnStart;
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);
bool finishFunction(MachineFunction &F);

View File

@ -48,7 +48,7 @@ namespace llvm {
///
struct CopyRecSort : public std::binary_function<CopyRec,CopyRec,bool> {
JoinPriorityQueue<CopyRecSort> *JPQ;
CopyRecSort(JoinPriorityQueue<CopyRecSort> *jpq) : JPQ(jpq) {}
explicit CopyRecSort(JoinPriorityQueue<CopyRecSort> *jpq) : JPQ(jpq) {}
CopyRecSort(const CopyRecSort &RHS) : JPQ(RHS.JPQ) {}
bool operator()(CopyRec left, CopyRec right) const;
};
@ -61,7 +61,8 @@ namespace llvm {
std::priority_queue<CopyRec, std::vector<CopyRec>, SF> Queue;
public:
JoinPriorityQueue(SimpleRegisterCoalescing *rc) : Rc(rc), Queue(SF(this)) {}
explicit JoinPriorityQueue(SimpleRegisterCoalescing *rc)
: Rc(rc), Queue(SF(this)) {}
bool empty() const { return Queue.empty(); }
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);
GenericValue lle_X_fgets(FunctionType *FT, const vector<GenericValue> &Args) {
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]))));
}