/// Argument ctor - If Function argument is specified, this argument is
/// inserted at the end of the argument list for the function.
///
- Argument(const Type *Ty, const std::string &Name = "", Function *F = 0);
+ explicit Argument(const Type *Ty,
+ const std::string &Name = "",
+ Function *F = 0);
inline const Function *getParent() const { return Parent; }
inline Function *getParent() { return Parent; }
/// is automatically inserted at either the end of the function (if
/// InsertBefore is null), or before the specified basic block.
///
- BasicBlock(const std::string &Name = "", Function *Parent = 0,
- BasicBlock *InsertBefore = 0);
+ explicit BasicBlock(const std::string &Name = "", Function *Parent = 0,
+ BasicBlock *InsertBefore = 0);
~BasicBlock();
/// getParent - Return the enclosing method, or null if none
bool IsLandingPad;
public:
- MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb),
- Number(-1), Parent(0),
- IsLandingPad(false) {
+ explicit MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0),
+ BB(bb), Number(-1),
+ Parent(0),
+ IsLandingPad(false) {
Insts.parent = this;
}
const Type *Ty;
public:
- MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
+ explicit MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
virtual ~MachineConstantPoolValue() {};
/// getType - get type of this MachineConstantPoolValue.
class MachineInstrBuilder {
MachineInstr *MI;
public:
- MachineInstrBuilder(MachineInstr *mi) : MI(mi) {}
+ explicit MachineInstrBuilder(MachineInstr *mi) : MI(mi) {}
/// Allow automatic conversion to the machine instruction we are working on.
///
/// MBBs - The vector of basic blocks from which to create the jump table.
std::vector<MachineBasicBlock*> MBBs;
- MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M) : MBBs(M) {}
+ explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M)
+ : MBBs(M) {}
};
class MachineJumpTableInfo {
, Register(0)
, Offset(0)
{}
- MachineLocation(unsigned R)
+ explicit MachineLocation(unsigned R)
: IsRegister(true)
, Register(R)
, Offset(0)
std::vector<SDNode*> TopOrder;
unsigned DAGSize;
- SelectionDAGISel(TargetLowering &tli) : TLI(tli), DAGSize(0), JT(0,0,0,0) {}
+ explicit SelectionDAGISel(TargetLowering &tli)
+ : TLI(tli), DAGSize(0), JT(0,0,0,0) {}
TargetLowering &getTargetLowering() { return TLI; }
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
SDOperand Op;
public:
- HandleSDNode(SDOperand X)
+ explicit HandleSDNode(SDOperand X)
: SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)), Op(X) {
InitOperands(&Op, 1);
}
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- StringSDNode(const std::string &val)
+ explicit StringSDNode(const std::string &val)
: SDNode(ISD::STRING, getSDVTList(MVT::Other)), Value(val) {
}
public:
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- BasicBlockSDNode(MachineBasicBlock *mbb)
+ explicit BasicBlockSDNode(MachineBasicBlock *mbb)
: SDNode(ISD::BasicBlock, getSDVTList(MVT::Other)), MBB(mbb) {
}
public:
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- CondCodeSDNode(ISD::CondCode Cond)
+ explicit CondCodeSDNode(ISD::CondCode Cond)
: SDNode(ISD::CONDCODE, getSDVTList(MVT::Other)), Condition(Cond) {
}
public:
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- VTSDNode(MVT::ValueType VT)
+ explicit VTSDNode(MVT::ValueType VT)
: SDNode(ISD::VALUETYPE, getSDVTList(MVT::Other)), ValueType(VT) {
}
public:
friend struct ConstantCreator<ConstantAggregateZero, Type, char>;
ConstantAggregateZero(const ConstantAggregateZero &); // DO NOT IMPLEMENT
protected:
- ConstantAggregateZero(const Type *Ty)
+ explicit ConstantAggregateZero(const Type *Ty)
: Constant(Ty, ConstantAggregateZeroVal, 0, 0) {}
public:
/// get() - static factory method for creating a null aggregate. It is
friend struct ConstantCreator<ConstantPointerNull, PointerType, char>;
ConstantPointerNull(const ConstantPointerNull &); // DO NOT IMPLEMENT
protected:
- ConstantPointerNull(const PointerType *T)
+ explicit ConstantPointerNull(const PointerType *T)
: Constant(reinterpret_cast<const Type*>(T),
Value::ConstantPointerNullVal, 0, 0) {}
friend struct ConstantCreator<UndefValue, Type, char>;
UndefValue(const UndefValue &); // DO NOT IMPLEMENT
protected:
- UndefValue(const Type *T) : Constant(T, UndefValueVal, 0, 0) {}
+ explicit UndefValue(const Type *T) : Constant(T, UndefValueVal, 0, 0) {}
public:
/// get() - Static factory methods - Return an 'undef' object of the specified
/// type.
friend class Type;
protected:
- DerivedType(TypeID id) : Type(id) {}
+ explicit DerivedType(TypeID id) : Type(id) {}
/// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type
/// that the current type has transitioned from being abstract to being
/// @brief Integer representation type
class IntegerType : public DerivedType {
protected:
- IntegerType(unsigned NumBits) : DerivedType(IntegerTyID) {
+ explicit IntegerType(unsigned NumBits) : DerivedType(IntegerTyID) {
setSubclassData(NumBits);
}
friend class TypeMap<IntegerValType, IntegerType>;
/// and VectorType
class CompositeType : public DerivedType {
protected:
- inline CompositeType(TypeID id) : DerivedType(id) { }
+ inline explicit CompositeType(TypeID id) : DerivedType(id) { }
public:
/// getTypeAtIndex - Given an index value into the type, return the type of
friend class TypeMap<PointerValType, PointerType>;
PointerType(const PointerType &); // Do not implement
const PointerType &operator=(const PointerType &); // Do not implement
- PointerType(const Type *ElType);
+ explicit PointerType(const Type *ElType);
public:
/// PointerType::get - This is the only way to construct a new pointer type.
static PointerType *get(const Type *ElementType);
public:
/// The Module constructor. Note that there is no default constructor. You
/// must provide a name for the module upon construction.
- Module(const std::string &ModuleID);
+ explicit Module(const std::string &ModuleID);
/// The module destructor. This will dropAllReferences.
~Module();
AnalysisResolver(); // DO NOT IMPLEMENT
public:
- AnalysisResolver(PMDataManager &P) : PM(P) { }
+ explicit AnalysisResolver(PMDataManager &P) : PM(P) { }
inline PMDataManager &getPMDataManager() { return PM; }
/// FunctionPassManager manages FunctionPasses and BasicBlockPassManagers.
class FunctionPassManager {
public:
- FunctionPassManager(ModuleProvider *P);
+ explicit FunctionPassManager(ModuleProvider *P);
FunctionPassManager();
~FunctionPassManager();
/// then return NULL.
Pass *findAnalysisPass(AnalysisID AID);
- PMTopLevelManager(enum TopLevelManagerType t);
+ explicit PMTopLevelManager(enum TopLevelManagerType t);
virtual ~PMTopLevelManager();
/// Add immutable pass and initialize it.
class PMDataManager {
public:
- PMDataManager(int Depth) : TPM(NULL), Depth(Depth) {
+ explicit PMDataManager(int Depth) : TPM(NULL), Depth(Depth) {
initializeAnalysisInfo();
}
class FPPassManager : public ModulePass, public PMDataManager {
public:
- FPPassManager(int Depth) : PMDataManager(Depth) { }
+ explicit FPPassManager(int Depth) : PMDataManager(Depth) { }
/// 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.
const PassInfo *ImplementationInfo;
bool isDefaultImplementation;
protected:
- RegisterAGBase(const std::type_info &Interface,
- const std::type_info *Pass = 0,
- bool isDefault = false);
+ explicit RegisterAGBase(const std::type_info &Interface,
+ const std::type_info *Pass = 0,
+ bool isDefault = false);
void setGroupName(const char *Name);
};
template<typename Interface, bool Default = false>
struct RegisterAnalysisGroup : public RegisterAGBase {
- RegisterAnalysisGroup(RegisterPassBase &RPB)
+ explicit RegisterAnalysisGroup(RegisterPassBase &RPB)
: RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(),
Default) {
}
- RegisterAnalysisGroup(const char *Name)
+ explicit RegisterAnalysisGroup(const char *Name)
: RegisterAGBase(typeid(Interface)) {
setGroupName(Name);
}
const Type *getForwardedTypeInternal() const;
protected:
Type(const char *Name, TypeID id);
- Type(TypeID id) : ID(id), Abstract(false), SubclassData(0), RefCount(0),
- ForwardType(0) {}
+ explicit Type(TypeID id) : ID(id), Abstract(false), SubclassData(0),
+ RefCount(0), ForwardType(0) {}
virtual ~Type() {
assert(AbstractTypeUsers.empty());
}