summaryrefslogtreecommitdiff
path: root/include/llvm/IR
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-03-05 06:35:38 +0000
committerCraig Topper <craig.topper@gmail.com>2014-03-05 06:35:38 +0000
commit98f54c09d086f76fa0ec81fc2c01d45bfe5a3739 (patch)
tree90539ede4e5a33ce3675f437ba062c76cc867d47 /include/llvm/IR
parent0bfd526b6b5b3173bfabf6fd5a5b02369fb8b132 (diff)
downloadllvm-98f54c09d086f76fa0ec81fc2c01d45bfe5a3739.tar.gz
llvm-98f54c09d086f76fa0ec81fc2c01d45bfe5a3739.tar.bz2
llvm-98f54c09d086f76fa0ec81fc2c01d45bfe5a3739.tar.xz
[C++11] Add 'override' keyword to IR library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR')
-rw-r--r--include/llvm/IR/Constant.h4
-rw-r--r--include/llvm/IR/Constants.h36
-rw-r--r--include/llvm/IR/DiagnosticInfo.h6
-rw-r--r--include/llvm/IR/DiagnosticPrinter.h34
-rw-r--r--include/llvm/IR/Dominators.h10
-rw-r--r--include/llvm/IR/Function.h6
-rw-r--r--include/llvm/IR/GlobalAlias.h4
-rw-r--r--include/llvm/IR/GlobalValue.h2
-rw-r--r--include/llvm/IR/GlobalVariable.h8
-rw-r--r--include/llvm/IR/Instructions.h120
-rw-r--r--include/llvm/IR/LegacyPassManager.h4
-rw-r--r--include/llvm/IR/LegacyPassManagers.h20
-rw-r--r--include/llvm/IR/LegacyPassNameParser.h10
13 files changed, 133 insertions, 131 deletions
diff --git a/include/llvm/IR/Constant.h b/include/llvm/IR/Constant.h
index 26bad1dd1f..f03e3dd455 100644
--- a/include/llvm/IR/Constant.h
+++ b/include/llvm/IR/Constant.h
@@ -41,8 +41,8 @@ namespace llvm {
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) {}
diff --git a/include/llvm/IR/Constants.h b/include/llvm/IR/Constants.h
index 448d82931a..ed7a70f773 100644
--- a/include/llvm/IR/Constants.h
+++ b/include/llvm/IR/Constants.h
@@ -49,7 +49,7 @@ struct ConvertConstantType;
/// 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);
@@ -231,7 +231,7 @@ public:
///
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;
@@ -308,7 +308,7 @@ protected:
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.
@@ -356,8 +356,8 @@ public:
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) {
@@ -414,8 +414,8 @@ public:
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) {
@@ -461,8 +461,8 @@ public:
/// 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) {
@@ -497,7 +497,7 @@ public:
/// 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.
@@ -624,7 +624,7 @@ public:
/// 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:
///
@@ -645,7 +645,7 @@ private:
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) {}
@@ -697,7 +697,7 @@ public:
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) {}
@@ -769,8 +769,8 @@ public:
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) {
@@ -1099,8 +1099,8 @@ public:
/// 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) {
@@ -1164,7 +1164,7 @@ public:
/// 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) {
diff --git a/include/llvm/IR/DiagnosticInfo.h b/include/llvm/IR/DiagnosticInfo.h
index 9b99ce6cd7..de2a9d8b1a 100644
--- a/include/llvm/IR/DiagnosticInfo.h
+++ b/include/llvm/IR/DiagnosticInfo.h
@@ -128,7 +128,7 @@ public:
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) {
@@ -156,7 +156,7 @@ public:
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) {
@@ -185,7 +185,7 @@ public:
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) {
diff --git a/include/llvm/IR/DiagnosticPrinter.h b/include/llvm/IR/DiagnosticPrinter.h
index 6177b7fe10..411c781e01 100644
--- a/include/llvm/IR/DiagnosticPrinter.h
+++ b/include/llvm/IR/DiagnosticPrinter.h
@@ -62,25 +62,25 @@ public:
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
diff --git a/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h
index 550b634a24..987ff1944e 100644
--- a/include/llvm/IR/Dominators.h
+++ b/include/llvm/IR/Dominators.h
@@ -176,17 +176,17 @@ public:
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
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index bba7ecdd23..11208bb917 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -335,7 +335,7 @@ public:
/// 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.
@@ -348,12 +348,12 @@ public:
/// 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
diff --git a/include/llvm/IR/GlobalAlias.h b/include/llvm/IR/GlobalAlias.h
index fec61a7cea..81777af386 100644
--- a/include/llvm/IR/GlobalAlias.h
+++ b/include/llvm/IR/GlobalAlias.h
@@ -49,12 +49,12 @@ public:
/// 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);
diff --git a/include/llvm/IR/GlobalValue.h b/include/llvm/IR/GlobalValue.h
index 32108b153c..e490023db1 100644
--- a/include/llvm/IR/GlobalValue.h
+++ b/include/llvm/IR/GlobalValue.h
@@ -281,7 +281,7 @@ public:
/// @}
/// 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.
diff --git a/include/llvm/IR/GlobalVariable.h b/include/llvm/IR/GlobalVariable.h
index 660092df3d..a82740f710 100644
--- a/include/llvm/IR/GlobalVariable.h
+++ b/include/llvm/IR/GlobalVariable.h
@@ -174,21 +174,21 @@ public:
/// 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) {
diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h
index 24912d7d5c..c249f878c4 100644
--- a/include/llvm/IR/Instructions.h
+++ b/include/llvm/IR/Instructions.h
@@ -57,7 +57,7 @@ enum SynchronizationScope {
///
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);
@@ -150,7 +150,7 @@ private:
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);
@@ -270,7 +270,7 @@ class StoreInst : public Instruction {
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) {
@@ -397,7 +397,7 @@ class FenceInst : public Instruction {
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) {
@@ -465,7 +465,7 @@ class AtomicCmpXchgInst : public Instruction {
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) {
@@ -570,7 +570,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(AtomicCmpXchgInst, Value)
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,
@@ -735,7 +735,7 @@ class GetElementPtrInst : public Instruction {
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 = "",
@@ -937,7 +937,7 @@ class ICmpInst: public CmpInst {
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(
@@ -1069,7 +1069,7 @@ public:
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(
@@ -1192,7 +1192,7 @@ class CallInst : public Instruction {
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,
@@ -1464,7 +1464,7 @@ class SelectInst : public Instruction {
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 = "",
@@ -1519,7 +1519,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
///
class VAArgInst : public UnaryInstruction {
protected:
- virtual VAArgInst *clone_impl() const;
+ VAArgInst *clone_impl() const override;
public:
VAArgInst(Value *List, Type *Ty, const Twine &NameStr = "",
@@ -1559,7 +1559,7 @@ class ExtractElementInst : public Instruction {
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,
@@ -1620,7 +1620,7 @@ class InsertElementInst : public Instruction {
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,
@@ -1673,7 +1673,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertElementInst, Value)
///
class ShuffleVectorInst : public Instruction {
protected:
- virtual ShuffleVectorInst *clone_impl() const;
+ ShuffleVectorInst *clone_impl() const override;
public:
// allocate space for exactly three operands
@@ -1774,7 +1774,7 @@ class ExtractValueInst : public UnaryInstruction {
return User::operator new(s, 1);
}
protected:
- virtual ExtractValueInst *clone_impl() const;
+ ExtractValueInst *clone_impl() const override;
public:
static ExtractValueInst *Create(Value *Agg,
@@ -1885,7 +1885,7 @@ class InsertValueInst : public Instruction {
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) {
@@ -2020,7 +2020,7 @@ protected:
// 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).
@@ -2211,7 +2211,7 @@ private:
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).
@@ -2309,7 +2309,7 @@ private:
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) {
@@ -2342,9 +2342,9 @@ public:
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 <>
@@ -2381,7 +2381,7 @@ class BranchInst : public TerminatorInst {
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);
@@ -2441,9 +2441,9 @@ public:
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 <>
@@ -2487,7 +2487,7 @@ class SwitchInst : public TerminatorInst {
SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
BasicBlock *InsertAtEnd);
protected:
- virtual SwitchInst *clone_impl() const;
+ SwitchInst *clone_impl() const override;
public:
// -2
@@ -2734,9 +2734,9 @@ public:
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 <>
@@ -2779,7 +2779,7 @@ class IndirectBrInst : public TerminatorInst {
/// 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) {
@@ -2832,9 +2832,9 @@ public:
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 <>
@@ -2871,7 +2871,7 @@ class InvokeInst : public TerminatorInst {
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,
@@ -3055,9 +3055,9 @@ public:
}
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;
@@ -3110,7 +3110,7 @@ class ResumeInst : public TerminatorInst {
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);
@@ -3135,9 +3135,9 @@ public:
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 <>
@@ -3159,7 +3159,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ResumeInst, Value)
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
@@ -3179,9 +3179,9 @@ public:
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;
};
//===----------------------------------------------------------------------===//
@@ -3192,7 +3192,7 @@ private:
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
@@ -3228,7 +3228,7 @@ public:
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
@@ -3264,7 +3264,7 @@ public:
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
@@ -3300,7 +3300,7 @@ public:
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
@@ -3336,7 +3336,7 @@ public:
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
@@ -3372,7 +3372,7 @@ public:
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
@@ -3408,7 +3408,7 @@ public:
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
@@ -3444,7 +3444,7 @@ public:
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
@@ -3480,7 +3480,7 @@ public:
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
@@ -3532,7 +3532,7 @@ public:
);
/// \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 {
@@ -3556,7 +3556,7 @@ public:
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
@@ -3604,7 +3604,7 @@ public:
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
@@ -3641,7 +3641,7 @@ public:
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
diff --git a/include/llvm/IR/LegacyPassManager.h b/include/llvm/IR/LegacyPassManager.h
index fa1436ec63..c967a6bca8 100644
--- a/include/llvm/IR/LegacyPassManager.h
+++ b/include/llvm/IR/LegacyPassManager.h
@@ -55,7 +55,7 @@ public:
/// 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.
@@ -80,7 +80,7 @@ public:
/// 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
diff --git a/include/llvm/IR/LegacyPassManagers.h b/include/llvm/IR/LegacyPassManagers.h
index 6116132e61..5c9dccd8b2 100644
--- a/include/llvm/IR/LegacyPassManagers.h
+++ b/include/llvm/IR/LegacyPassManagers.h
@@ -127,7 +127,7 @@ public:
: 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;
};
@@ -414,7 +414,7 @@ public:
/// 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();
@@ -426,7 +426,7 @@ public:
/// 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
@@ -435,20 +435,20 @@ public:
/// 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";
}
@@ -458,7 +458,7 @@ public:
return FP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_FunctionPassManager;
}
};
diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
index b9c1d8b45c..1f6bbbcc09 100644
--- a/include/llvm/IR/LegacyPassNameParser.h
+++ b/include/llvm/IR/LegacyPassNameParser.h
@@ -68,7 +68,7 @@ public:
// 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 (-"
@@ -77,11 +77,11 @@ public:
}
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);
@@ -107,7 +107,9 @@ private:
Filter filter;
public:
- bool ignorablePassImpl(const PassInfo *P) const { return !filter(*P); }
+ bool ignorablePassImpl(const PassInfo *P) const override {
+ return !filter(*P);
+ }
};
///===----------------------------------------------------------------------===//