class Constant : public User {
void operator=(const Constant &) LLVM_DELETED_FUNCTION;
Constant(const Constant &) LLVM_DELETED_FUNCTION;
- virtual void anchor();
-
+ void anchor() override;
+
protected:
Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
: User(ty, vty, Ops, NumOps) {}
/// represents both boolean and integral constants.
/// @brief Class for constant integers.
class ConstantInt : public Constant {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
ConstantInt(const ConstantInt &) LLVM_DELETED_FUNCTION;
ConstantInt(IntegerType *Ty, const APInt& V);
///
class ConstantFP : public Constant {
APFloat Val;
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
ConstantFP(const ConstantFP &) LLVM_DELETED_FUNCTION;
friend class LLVMContextImpl;
public:
static ConstantAggregateZero *get(Type *Ty);
- virtual void destroyConstant();
+ void destroyConstant() override;
/// getSequentialElement - If this CAZ has array or vector type, return a zero
/// with the right element type.
return cast<ArrayType>(Value::getType());
}
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void destroyConstant() override;
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
return cast<StructType>(Value::getType());
}
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void destroyConstant() override;
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
/// elements have the same value, return that value. Otherwise return NULL.
Constant *getSplatValue() const;
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void destroyConstant() override;
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
/// get() - Static factory methods - Return objects of the specified value
static ConstantPointerNull *get(PointerType *T);
- virtual void destroyConstant();
+ void destroyConstant() override;
/// getType - Specialize the getType() method to always return an PointerType,
/// which reduces the amount of casting needed in parts of the compiler.
/// host endianness of the data elements.
StringRef getRawDataValues() const;
- virtual void destroyConstant();
+ void destroyConstant() override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
///
class ConstantDataArray : public ConstantDataSequential {
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
ConstantDataArray(const ConstantDataArray &) LLVM_DELETED_FUNCTION;
- virtual void anchor();
+ void anchor() override;
friend class ConstantDataSequential;
explicit ConstantDataArray(Type *ty, const char *Data)
: ConstantDataSequential(ty, ConstantDataArrayVal, Data) {}
class ConstantDataVector : public ConstantDataSequential {
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
ConstantDataVector(const ConstantDataVector &) LLVM_DELETED_FUNCTION;
- virtual void anchor();
+ void anchor() override;
friend class ConstantDataSequential;
explicit ConstantDataVector(Type *ty, const char *Data)
: ConstantDataSequential(ty, ConstantDataVectorVal, Data) {}
Function *getFunction() const { return (Function*)Op<0>().get(); }
BasicBlock *getBasicBlock() const { return (BasicBlock*)Op<1>().get(); }
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void destroyConstant() override;
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Value *V) {
/// would make it harder to remove ConstantExprs altogether.
Instruction *getAsInstruction();
- virtual void destroyConstant();
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void destroyConstant() override;
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Value *V) {
/// index.
UndefValue *getElementValue(unsigned Idx) const;
- virtual void destroyConstant();
+ void destroyConstant() override;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
const Instruction *getInstruction() const { return Instr; }
/// \see DiagnosticInfo::print.
- virtual void print(DiagnosticPrinter &DP) const;
+ void print(DiagnosticPrinter &DP) const override;
/// Hand rolled RTTI.
static bool classof(const DiagnosticInfo *DI) {
unsigned getStackSize() const { return StackSize; }
/// \see DiagnosticInfo::print.
- virtual void print(DiagnosticPrinter &DP) const;
+ void print(DiagnosticPrinter &DP) const override;
/// Hand rolled RTTI.
static bool classof(const DiagnosticInfo *DI) {
unsigned getMetadataVersion() const { return MetadataVersion; }
/// \see DiagnosticInfo::print.
- virtual void print(DiagnosticPrinter &DP) const;
+ void print(DiagnosticPrinter &DP) const override;
/// Hand rolled RTTI.
static bool classof(const DiagnosticInfo *DI) {
DiagnosticPrinterRawOStream(raw_ostream &Stream) : Stream(Stream) {};
// Simple types.
- virtual DiagnosticPrinter &operator<<(char C);
- virtual DiagnosticPrinter &operator<<(unsigned char C);
- virtual DiagnosticPrinter &operator<<(signed char C);
- virtual DiagnosticPrinter &operator<<(StringRef Str);
- virtual DiagnosticPrinter &operator<<(const char *Str);
- virtual DiagnosticPrinter &operator<<(const std::string &Str);
- virtual DiagnosticPrinter &operator<<(unsigned long N);
- virtual DiagnosticPrinter &operator<<(long N);
- virtual DiagnosticPrinter &operator<<(unsigned long long N);
- virtual DiagnosticPrinter &operator<<(long long N);
- virtual DiagnosticPrinter &operator<<(const void *P);
- virtual DiagnosticPrinter &operator<<(unsigned int N);
- virtual DiagnosticPrinter &operator<<(int N);
- virtual DiagnosticPrinter &operator<<(double N);
- virtual DiagnosticPrinter &operator<<(const Twine &Str);
+ DiagnosticPrinter &operator<<(char C) override;
+ DiagnosticPrinter &operator<<(unsigned char C) override;
+ DiagnosticPrinter &operator<<(signed char C) override;
+ DiagnosticPrinter &operator<<(StringRef Str) override;
+ DiagnosticPrinter &operator<<(const char *Str) override;
+ DiagnosticPrinter &operator<<(const std::string &Str) override;
+ DiagnosticPrinter &operator<<(unsigned long N) override;
+ DiagnosticPrinter &operator<<(long N) override;
+ DiagnosticPrinter &operator<<(unsigned long long N) override;
+ DiagnosticPrinter &operator<<(long long N) override;
+ DiagnosticPrinter &operator<<(const void *P) override;
+ DiagnosticPrinter &operator<<(unsigned int N) override;
+ DiagnosticPrinter &operator<<(int N) override;
+ DiagnosticPrinter &operator<<(double N) override;
+ DiagnosticPrinter &operator<<(const Twine &Str) override;
// IR related types.
- virtual DiagnosticPrinter &operator<<(const Value &V);
- virtual DiagnosticPrinter &operator<<(const Module &M);
+ DiagnosticPrinter &operator<<(const Value &V) override;
+ DiagnosticPrinter &operator<<(const Module &M) override;
};
} // End namespace llvm
DominatorTree &getDomTree() { return DT; }
const DominatorTree &getDomTree() const { return DT; }
- virtual bool runOnFunction(Function &F);
+ bool runOnFunction(Function &F) override;
- virtual void verifyAnalysis() const;
+ void verifyAnalysis() const override;
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
- virtual void releaseMemory() { DT.releaseMemory(); }
+ void releaseMemory() override { DT.releaseMemory(); }
- virtual void print(raw_ostream &OS, const Module *M = 0) const;
+ void print(raw_ostream &OS, const Module *M = 0) const override;
};
} // End llvm namespace
/// copyAttributesFrom - copy all additional attributes (those not needed to
/// create a Function) from the Function Src to this one.
- void copyAttributesFrom(const GlobalValue *Src);
+ void copyAttributesFrom(const GlobalValue *Src) override;
/// deleteBody - This method deletes the body of the function, and converts
/// the linkage to external.
/// removeFromParent - This method unlinks 'this' from the containing module,
/// but does not delete it.
///
- virtual void removeFromParent();
+ void removeFromParent() override;
/// eraseFromParent - This method unlinks 'this' from the containing module
/// and deletes it.
///
- virtual void eraseFromParent();
+ void eraseFromParent() override;
/// Get the underlying elements of the Function... the basic block list is
/// removeFromParent - This method unlinks 'this' from the containing module,
/// but does not delete it.
///
- virtual void removeFromParent();
+ void removeFromParent() override;
/// eraseFromParent - This method unlinks 'this' from the containing module
/// and deletes it.
///
- virtual void eraseFromParent();
+ void eraseFromParent() override;
/// set/getAliasee - These methods retrive and set alias target.
void setAliasee(Constant *GV);
/// @}
/// Override from Constant class.
- virtual void destroyConstant();
+ void destroyConstant() override;
/// isDeclaration - Return true if the primary definition of this global
/// value is outside of the current translation unit.
/// copyAttributesFrom - copy all additional attributes (those not needed to
/// create a GlobalVariable) from the GlobalVariable Src to this one.
- void copyAttributesFrom(const GlobalValue *Src);
+ void copyAttributesFrom(const GlobalValue *Src) override;
/// removeFromParent - This method unlinks 'this' from the containing module,
/// but does not delete it.
///
- virtual void removeFromParent();
+ void removeFromParent() override;
/// eraseFromParent - This method unlinks 'this' from the containing module
/// and deletes it.
///
- virtual void eraseFromParent();
+ void eraseFromParent() override;
/// Override Constant's implementation of this method so we can
/// replace constant initializers.
- virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
+ void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Value *V) {
///
class AllocaInst : public UnaryInstruction {
protected:
- virtual AllocaInst *clone_impl() const;
+ AllocaInst *clone_impl() const override;
public:
explicit AllocaInst(Type *Ty, Value *ArraySize = 0,
const Twine &Name = "", Instruction *InsertBefore = 0);
class LoadInst : public UnaryInstruction {
void AssertOK();
protected:
- virtual LoadInst *clone_impl() const;
+ LoadInst *clone_impl() const override;
public:
LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore);
LoadInst(Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
void AssertOK();
protected:
- virtual StoreInst *clone_impl() const;
+ StoreInst *clone_impl() const override;
public:
// allocate space for exactly two operands
void *operator new(size_t s) {
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
void Init(AtomicOrdering Ordering, SynchronizationScope SynchScope);
protected:
- virtual FenceInst *clone_impl() const;
+ FenceInst *clone_impl() const override;
public:
// allocate space for exactly zero operands
void *operator new(size_t s) {
void Init(Value *Ptr, Value *Cmp, Value *NewVal,
AtomicOrdering Ordering, SynchronizationScope SynchScope);
protected:
- virtual AtomicCmpXchgInst *clone_impl() const;
+ AtomicCmpXchgInst *clone_impl() const override;
public:
// allocate space for exactly three operands
void *operator new(size_t s) {
class AtomicRMWInst : public Instruction {
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
protected:
- virtual AtomicRMWInst *clone_impl() const;
+ AtomicRMWInst *clone_impl() const override;
public:
/// This enumeration lists the possible modifications atomicrmw can make. In
/// the descriptions, 'p' is the pointer to the instruction's memory location,
unsigned Values, const Twine &NameStr,
BasicBlock *InsertAtEnd);
protected:
- virtual GetElementPtrInst *clone_impl() const;
+ GetElementPtrInst *clone_impl() const override;
public:
static GetElementPtrInst *Create(Value *Ptr, ArrayRef<Value *> IdxList,
const Twine &NameStr = "",
protected:
/// \brief Clone an identical ICmpInst
- virtual ICmpInst *clone_impl() const;
+ ICmpInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics.
ICmpInst(
class FCmpInst: public CmpInst {
protected:
/// \brief Clone an identical FCmpInst
- virtual FCmpInst *clone_impl() const;
+ FCmpInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics.
FCmpInst(
Instruction *InsertBefore);
CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
protected:
- virtual CallInst *clone_impl() const;
+ CallInst *clone_impl() const override;
public:
static CallInst *Create(Value *Func,
ArrayRef<Value *> Args,
setName(NameStr);
}
protected:
- virtual SelectInst *clone_impl() const;
+ SelectInst *clone_impl() const override;
public:
static SelectInst *Create(Value *C, Value *S1, Value *S2,
const Twine &NameStr = "",
///
class VAArgInst : public UnaryInstruction {
protected:
- virtual VAArgInst *clone_impl() const;
+ VAArgInst *clone_impl() const override;
public:
VAArgInst(Value *List, Type *Ty, const Twine &NameStr = "",
ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
BasicBlock *InsertAtEnd);
protected:
- virtual ExtractElementInst *clone_impl() const;
+ ExtractElementInst *clone_impl() const override;
public:
static ExtractElementInst *Create(Value *Vec, Value *Idx,
InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
const Twine &NameStr, BasicBlock *InsertAtEnd);
protected:
- virtual InsertElementInst *clone_impl() const;
+ InsertElementInst *clone_impl() const override;
public:
static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
///
class ShuffleVectorInst : public Instruction {
protected:
- virtual ShuffleVectorInst *clone_impl() const;
+ ShuffleVectorInst *clone_impl() const override;
public:
// allocate space for exactly three operands
return User::operator new(s, 1);
}
protected:
- virtual ExtractValueInst *clone_impl() const;
+ ExtractValueInst *clone_impl() const override;
public:
static ExtractValueInst *Create(Value *Agg,
InsertValueInst(Value *Agg, Value *Val, unsigned Idx,
const Twine &NameStr, BasicBlock *InsertAtEnd);
protected:
- virtual InsertValueInst *clone_impl() const;
+ InsertValueInst *clone_impl() const override;
public:
// allocate space for exactly two operands
void *operator new(size_t s) {
// values and pointers to the incoming blocks, all in one allocation.
Use *allocHungoffUses(unsigned) const;
- virtual PHINode *clone_impl() const;
+ PHINode *clone_impl() const override;
public:
/// Constructors - NumReservedValues is a hint for the number of incoming
/// edges that this phi node will have (use 0 if you really have no idea).
unsigned NumReservedValues, const Twine &NameStr,
BasicBlock *InsertAtEnd);
protected:
- virtual LandingPadInst *clone_impl() const;
+ LandingPadInst *clone_impl() const override;
public:
/// Constructors - NumReservedClauses is a hint for the number of incoming
/// clauses that this landingpad will have (use 0 if you really have no idea).
ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
protected:
- virtual ReturnInst *clone_impl() const;
+ ReturnInst *clone_impl() const override;
public:
static ReturnInst* Create(LLVMContext &C, Value *retVal = 0,
Instruction *InsertBefore = 0) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
template <>
BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
BasicBlock *InsertAtEnd);
protected:
- virtual BranchInst *clone_impl() const;
+ BranchInst *clone_impl() const override;
public:
static BranchInst *Create(BasicBlock *IfTrue, Instruction *InsertBefore = 0) {
return new(1) BranchInst(IfTrue, InsertBefore);
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
template <>
SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
BasicBlock *InsertAtEnd);
protected:
- virtual SwitchInst *clone_impl() const;
+ SwitchInst *clone_impl() const override;
public:
// -2
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
template <>
/// autoinserts at the end of the specified BasicBlock.
IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
protected:
- virtual IndirectBrInst *clone_impl() const;
+ IndirectBrInst *clone_impl() const override;
public:
static IndirectBrInst *Create(Value *Address, unsigned NumDests,
Instruction *InsertBefore = 0) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
template <>
ArrayRef<Value *> Args, unsigned Values,
const Twine &NameStr, BasicBlock *InsertAtEnd);
protected:
- virtual InvokeInst *clone_impl() const;
+ InvokeInst *clone_impl() const override;
public:
static InvokeInst *Create(Value *Func,
BasicBlock *IfNormal, BasicBlock *IfException,
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
bool hasFnAttrImpl(Attribute::AttrKind A) const;
explicit ResumeInst(Value *Exn, Instruction *InsertBefore=0);
ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
protected:
- virtual ResumeInst *clone_impl() const;
+ ResumeInst *clone_impl() const override;
public:
static ResumeInst *Create(Value *Exn, Instruction *InsertBefore = 0) {
return new(1) ResumeInst(Exn, InsertBefore);
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
template <>
class UnreachableInst : public TerminatorInst {
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
protected:
- virtual UnreachableInst *clone_impl() const;
+ UnreachableInst *clone_impl() const override;
public:
// allocate space for exactly zero operands
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
+ BasicBlock *getSuccessorV(unsigned idx) const override;
+ unsigned getNumSuccessorsV() const override;
+ void setSuccessorV(unsigned idx, BasicBlock *B) override;
};
//===----------------------------------------------------------------------===//
class TruncInst : public CastInst {
protected:
/// \brief Clone an identical TruncInst
- virtual TruncInst *clone_impl() const;
+ TruncInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class ZExtInst : public CastInst {
protected:
/// \brief Clone an identical ZExtInst
- virtual ZExtInst *clone_impl() const;
+ ZExtInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class SExtInst : public CastInst {
protected:
/// \brief Clone an identical SExtInst
- virtual SExtInst *clone_impl() const;
+ SExtInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class FPTruncInst : public CastInst {
protected:
/// \brief Clone an identical FPTruncInst
- virtual FPTruncInst *clone_impl() const;
+ FPTruncInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class FPExtInst : public CastInst {
protected:
/// \brief Clone an identical FPExtInst
- virtual FPExtInst *clone_impl() const;
+ FPExtInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class UIToFPInst : public CastInst {
protected:
/// \brief Clone an identical UIToFPInst
- virtual UIToFPInst *clone_impl() const;
+ UIToFPInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class SIToFPInst : public CastInst {
protected:
/// \brief Clone an identical SIToFPInst
- virtual SIToFPInst *clone_impl() const;
+ SIToFPInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class FPToUIInst : public CastInst {
protected:
/// \brief Clone an identical FPToUIInst
- virtual FPToUIInst *clone_impl() const;
+ FPToUIInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class FPToSIInst : public CastInst {
protected:
/// \brief Clone an identical FPToSIInst
- virtual FPToSIInst *clone_impl() const;
+ FPToSIInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
);
/// \brief Clone an identical IntToPtrInst
- virtual IntToPtrInst *clone_impl() const;
+ IntToPtrInst *clone_impl() const override;
/// \brief Returns the address space of this instruction's pointer type.
unsigned getAddressSpace() const {
class PtrToIntInst : public CastInst {
protected:
/// \brief Clone an identical PtrToIntInst
- virtual PtrToIntInst *clone_impl() const;
+ PtrToIntInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class BitCastInst : public CastInst {
protected:
/// \brief Clone an identical BitCastInst
- virtual BitCastInst *clone_impl() const;
+ BitCastInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
class AddrSpaceCastInst : public CastInst {
protected:
/// \brief Clone an identical AddrSpaceCastInst
- virtual AddrSpaceCastInst *clone_impl() const;
+ AddrSpaceCastInst *clone_impl() const override;
public:
/// \brief Constructor with insert-before-instruction semantics
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
/// implies that all passes MUST be allocated with 'new'.
- void add(Pass *P);
+ void add(Pass *P) override;
/// 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.
/// PassManager_X is destroyed, the pass will be destroyed as well, so
/// there is no need to delete the pass.
/// This implies that all passes MUST be allocated with 'new'.
- void add(Pass *P);
+ void add(Pass *P) override;
/// run - Execute all of the passes scheduled for execution. Keep
/// track of whether any of the passes modifies the function, and if
: P(p), V(0), M(&m) {} // When P is run on M
/// print - Emit information about this stack frame to OS.
- virtual void print(raw_ostream &OS) const;
+ void print(raw_ostream &OS) const override;
};
/// 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.
bool runOnFunction(Function &F);
- bool runOnModule(Module &M);
+ bool runOnModule(Module &M) override;
/// cleanup - After running all passes, clean up pass manager cache.
void cleanup();
/// doInitialization - Run all of the initializers for the function passes.
///
- bool doInitialization(Module &M);
+ bool doInitialization(Module &M) override;
/// doFinalization - Overrides ModulePass doFinalization for global
/// finalization tasks
/// doFinalization - Run all of the finalizers for the function passes.
///
- bool doFinalization(Module &M);
+ bool doFinalization(Module &M) override;
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
/// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
+ void getAnalysisUsage(AnalysisUsage &Info) const override{
Info.setPreservesAll();
}
// Print passes managed by this manager
- void dumpPassStructure(unsigned Offset);
+ void dumpPassStructure(unsigned Offset) override;
- virtual const char *getPassName() const {
+ const char *getPassName() const override {
return "Function Pass Manager";
}
return FP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_FunctionPassManager;
}
};
// Implement the PassRegistrationListener callbacks used to populate our map
//
- virtual void passRegistered(const PassInfo *P) {
+ void passRegistered(const PassInfo *P) override {
if (ignorablePass(P) || !Opt) return;
if (findOption(P->getPassArgument()) != getNumOptions()) {
errs() << "Two passes with the same argument (-"
}
addLiteralOption(P->getPassArgument(), P, P->getPassName());
}
- virtual void passEnumerate(const PassInfo *P) { passRegistered(P); }
+ void passEnumerate(const PassInfo *P) override { passRegistered(P); }
// printOptionInfo - Print out information about this option. Override the
// default implementation to sort the table before we print...
- virtual void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const {
+ void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const override {
PassNameParser *PNP = const_cast<PassNameParser*>(this);
array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan);
cl::parser<const PassInfo*>::printOptionInfo(O, GlobalWidth);
Filter filter;
public:
- bool ignorablePassImpl(const PassInfo *P) const { return !filter(*P); }
+ bool ignorablePassImpl(const PassInfo *P) const override {
+ return !filter(*P);
+ }
};
///===----------------------------------------------------------------------===//
class ModulePass : public Pass {
public:
/// createPrinterPass - Get a module printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override;
/// runOnModule - Virtual method overriden by subclasses to process the module
/// being operated on.
virtual bool runOnModule(Module &M) = 0;
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T);
+ void assignPassManager(PMStack &PMS, PassManagerType T) override;
/// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const;
+ PassManagerType getPotentialPassManagerType() const override;
explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
// Force out-of-line virtual method.
///
virtual void initializePass();
- virtual ImmutablePass *getAsImmutablePass() { return this; }
+ ImmutablePass *getAsImmutablePass() override { return this; }
/// ImmutablePasses are never run.
///
- bool runOnModule(Module &) { return false; }
+ bool runOnModule(Module &) override { return false; }
explicit ImmutablePass(char &pid)
: ModulePass(pid) {}
explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
/// createPrinterPass - Get a function printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override;
/// runOnFunction - Virtual method overriden by subclasses to do the
/// per-function processing of the pass.
///
virtual bool runOnFunction(Function &F) = 0;
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T);
+ void assignPassManager(PMStack &PMS, PassManagerType T) override;
/// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const;
+ PassManagerType getPotentialPassManagerType() const override;
protected:
/// skipOptnoneFunction - This function has Attribute::OptimizeNone
explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
/// createPrinterPass - Get a basic block printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override;
using llvm::Pass::doInitialization;
using llvm::Pass::doFinalization;
///
virtual bool doFinalization(Function &);
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType T);
+ void assignPassManager(PMStack &PMS, PassManagerType T) override;
/// Return what kind of Pass Manager can manage this pass.
- virtual PassManagerType getPotentialPassManagerType() const;
+ PassManagerType getPotentialPassManagerType() const override;
protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
};
class AlignAttributeImpl : public EnumAttributeImpl {
- virtual void anchor();
+ void anchor() override;
unsigned Align;
public:
/// UnaryConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement unary constant exprs.
class UnaryConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly one operand
/// BinaryConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement binary constant exprs.
class BinaryConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly two operands
/// SelectConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement select constant exprs.
class SelectConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly three operands
/// Constants.cpp, and is used behind the scenes to implement
/// extractelement constant exprs.
class ExtractElementConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly two operands
/// Constants.cpp, and is used behind the scenes to implement
/// insertelement constant exprs.
class InsertElementConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly three operands
/// Constants.cpp, and is used behind the scenes to implement
/// shufflevector constant exprs.
class ShuffleVectorConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly three operands
/// Constants.cpp, and is used behind the scenes to implement
/// extractvalue constant exprs.
class ExtractValueConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly one operand
/// Constants.cpp, and is used behind the scenes to implement
/// insertvalue constant exprs.
class InsertValueConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly one operand
/// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
/// used behind the scenes to implement getelementpr constant exprs.
class GetElementPtrConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
GetElementPtrConstantExpr(Constant *C, ArrayRef<Constant*> IdxList,
Type *DestTy);
public:
// behind the scenes to implement ICmp and FCmp constant expressions. This is
// needed in order to store the predicate value for these instructions.
class CompareConstantExpr : public ConstantExpr {
- virtual void anchor();
+ void anchor() override;
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
public:
// allocate space for exactly two operands
PrintModulePassWrapper(raw_ostream &OS, const std::string &Banner)
: ModulePass(ID), P(OS, Banner) {}
- bool runOnModule(Module &M) {
+ bool runOnModule(Module &M) override {
P.run(&M);
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
: FunctionPass(ID), P(OS, Banner) {}
// This pass just prints a banner followed by the function as it's processed.
- bool runOnFunction(Function &F) {
+ bool runOnFunction(Function &F) override {
P.run(&F);
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
PrintBasicBlockPass(raw_ostream &Out, const std::string &Banner)
: BasicBlockPass(ID), Out(Out), Banner(Banner) {}
- bool runOnBasicBlock(BasicBlock &BB) {
+ bool runOnBasicBlock(BasicBlock &BB) override {
Out << Banner << BB;
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override{
AU.setPreservesAll();
}
};
MDNode *get() const {
return cast_or_null<MDNode>(getValPtr());
}
-
- virtual void deleted();
- virtual void allUsesReplacedWith(Value *VNew);
+
+ void deleted() override;
+ void allUsesReplacedWith(Value *VNew) override;
};
class LLVMContextImpl {
/// Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the function, and if so, return true.
- bool runOnFunction(Function &F);
+ bool runOnFunction(Function &F) override;
/// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
+ void getAnalysisUsage(AnalysisUsage &Info) const override {
Info.setPreservesAll();
}
- bool doInitialization(Module &M);
+ bool doInitialization(Module &M) override;
bool doInitialization(Function &F);
- bool doFinalization(Module &M);
+ bool doFinalization(Module &M) override;
bool doFinalization(Function &F);
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
- virtual const char *getPassName() const {
+ const char *getPassName() const override {
return "BasicBlock Pass Manager";
}
// Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
+ void dumpPassStructure(unsigned Offset) override {
dbgs().indent(Offset*2) << "BasicBlockPass Manager\n";
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
BasicBlockPass *BP = getContainedPass(Index);
return BP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_BasicBlockPassManager;
}
};
}
/// createPrinterPass - Get a function printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override {
return createPrintFunctionPass(O, Banner);
}
/// doInitialization - Run all of the initializers for the function passes.
///
- bool doInitialization(Module &M);
+ bool doInitialization(Module &M) override;
/// doFinalization - Run all of the finalizers for the function passes.
///
- bool doFinalization(Module &M);
+ bool doFinalization(Module &M) override;
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
- virtual PassManagerType getTopLevelPassManagerType() {
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
+ PassManagerType getTopLevelPassManagerType() override {
return PMT_FunctionPassManager;
}
/// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
+ void getAnalysisUsage(AnalysisUsage &Info) const override {
Info.setPreservesAll();
}
}
/// createPrinterPass - Get a module printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override {
return createPrintModulePass(O, Banner);
}
bool doFinalization();
/// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
+ void getAnalysisUsage(AnalysisUsage &Info) const override {
Info.setPreservesAll();
}
/// Add RequiredPass into list of lower level passes required by pass P.
/// RequiredPass is run on the fly by Pass Manager when P requests it
/// through getAnalysis interface.
- virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
+ void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) override;
/// Return function pass corresponding to PassInfo PI, that is
/// required by module pass MP. Instantiate analysis pass, by using
/// its runOnFunction() for function F.
- virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F);
+ Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F) override;
- virtual const char *getPassName() const {
+ const char *getPassName() const override {
return "Module Pass Manager";
}
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
// Print passes managed by this manager
- void dumpPassStructure(unsigned Offset) {
+ void dumpPassStructure(unsigned Offset) override {
dbgs().indent(Offset*2) << "ModulePass Manager\n";
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index);
return static_cast<ModulePass *>(PassVector[N]);
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_ModulePassManager;
}
}
/// createPrinterPass - Get a module printer pass.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override {
return createPrintModulePass(O, Banner);
}
bool doFinalization();
/// Pass Manager itself does not invalidate any analysis info.
- void getAnalysisUsage(AnalysisUsage &Info) const {
+ void getAnalysisUsage(AnalysisUsage &Info) const override {
Info.setPreservesAll();
}
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
- virtual PassManagerType getTopLevelPassManagerType() {
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
+ PassManagerType getTopLevelPassManagerType() override {
return PMT_ModulePassManager;
}
/// the list.
void setAsFirstOperand(unsigned V) { this->setValPtrInt(V); }
- virtual void deleted();
- virtual void allUsesReplacedWith(Value *NV);
+ void deleted() override;
+ void allUsesReplacedWith(Value *NV) override;
};
} // end namespace llvm.
VectorType &CFGOnlyList;
GetCFGOnlyPasses(VectorType &L) : CFGOnlyList(L) {}
- void passEnumerate(const PassInfo *P) {
+ void passEnumerate(const PassInfo *P) override {
if (P->isCFGOnlyPass())
CFGOnlyList.push_back(P->getTypeInfo());
}
initializeVerifierLegacyPassPass(*PassRegistry::getPassRegistry());
}
- bool runOnFunction(Function &F) {
+ bool runOnFunction(Function &F) override {
if (!V.verify(F) && FatalErrors)
report_fatal_error("Broken function found, compilation aborted!");
return false;
}
- bool doFinalization(Module &M) {
+ bool doFinalization(Module &M) override {
if (!V.verify(M) && FatalErrors)
report_fatal_error("Broken module found, compilation aborted!");
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};