unsigned ID;
AnnotationID(); // Default ctor is disabled
- inline AnnotationID(unsigned i) : ID(i) {} // Only creatable from AnnMgr
+
+ // AnnotationID is only creatable from AnnMgr.
+ explicit inline AnnotationID(unsigned i) : ID(i) {}
public:
inline AnnotationID(const AnnotationID &A) : ID(A.ID) {}
AnnotationID ID; // ID number, as obtained from AnnotationManager
Annotation *Next; // The next annotation in the linked list
public:
- inline Annotation(AnnotationID id) : ID(id), Next(0) {}
+ explicit inline Annotation(AnnotationID id) : ID(id), Next(0) {}
virtual ~Annotation(); // Designed to be subclassed
// getID - Return the unique ID# of this annotation
// exit is called.
struct extrahelp {
const char * morehelp;
- extrahelp(const char* help);
+ explicit extrahelp(const char* help);
};
void PrintVersionMessage();
public:
/// Initialize a full (the default) or empty set for the specified bit width.
///
- ConstantRange(uint32_t BitWidth, bool isFullSet = true);
+ explicit ConstantRange(uint32_t BitWidth, bool isFullSet = true);
/// Initialize a range to hold the single specified value.
///
public SelectionDAG::DAGUpdateListener {
DAGCombiner &DC;
public:
- WorkListRemover(DAGCombiner &dc) : DC(dc) {}
+ explicit WorkListRemover(DAGCombiner &dc) : DC(dc) {}
virtual void NodeDeleted(SDNode *N) {
DC.removeFromWorkList(N);
IDMapType::iterator I = IDMap->find(Name);
if (I == IDMap->end()) {
(*IDMap)[Name] = IDCounter++; // Add a new element
- return IDCounter-1;
+ return AnnotationID(IDCounter-1);
}
- return I->second;
+ return AnnotationID(I->second);
}
// getID - Name -> ID + registration of a factory function for demand driven
else if (isa<ConstantPointerNull>(V))
return ConstantRange(APInt::getNullValue(typeToWidth(V->getType())));
else
- return typeToWidth(V->getType());
+ return ConstantRange(typeToWidth(V->getType()));
}
// typeToWidth - returns the number of bits necessary to store a value of