Add explicit keywords, and fix a minor typo that they uncovered.
authorDan Gohman <gohman@apple.com>
Fri, 14 Dec 2007 15:41:34 +0000 (15:41 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 14 Dec 2007 15:41:34 +0000 (15:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45034 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringMap.h
include/llvm/ExecutionEngine/ExecutionEngine.h
include/llvm/ExecutionEngine/GenericValue.h
lib/Analysis/IPA/Andersens.cpp
lib/CodeGen/CollectorMetadata.cpp
lib/CodeGen/ELFWriter.cpp
lib/CodeGen/SimpleRegisterCoalescing.h
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

index 1fa128a5fc5b29b007c9698aa629e6fcbd2be26f..745428880bea5c6d30bb44e48d3dce76ae18fd63 100644 (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 {
index 5b33e15d906d5d6628620ce52eef8c823620f08c..cc0ab0bcd9fa8181d5613f4518ad269e0d0e66e0 100644 (file)
@@ -248,7 +248,7 @@ public:
   }
 
 protected:
-  ExecutionEngine(ModuleProvider *P);
+  explicit ExecutionEngine(ModuleProvider *P);
 
   void emitGlobals();
 
index fab82af405e39588e309bb2299b3dbc807a37aec..0371009bdd43e1a9dd3b86f40bbbdfb856b45ada 100644 (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); }
index cc7ad7e7a779096ac07ab62e167fd0b1abc3fcfb..474781f6df379d73a0517c638c6716f4f6169e80 100644 (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),
index 57349390b01b8215a32c64717a5b56b762184807..43f3d431e97903ada1cd4c0ffb4bd19da9fa3ce5 100644 (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;
index efdf029c4a33f89caf0ad927d03cd34a8f98332e..d054adb9de6f9566bfb547f31ef2e5175bf5a8ad 100644 (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);
index c3b28956635e5b91fdf446da70feff04cf4be30f..fcdab4a51829567f1bdcfb00ade3db8d260346ce 100644 (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); }
index f45875faa38416495b33eeaf61ce0d9a66dd1f38..4e9b77be84f5b6ed384481fc913d2859d4126f95 100644 (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]))));
 }