[C++11] Add 'override' keyword to IR library.
authorCraig Topper <craig.topper@gmail.com>
Wed, 5 Mar 2014 06:35:38 +0000 (06:35 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 5 Mar 2014 06:35:38 +0000 (06:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202939 91177308-0d34-0410-b5e6-96231b3b80d8

22 files changed:
include/llvm/IR/Constant.h
include/llvm/IR/Constants.h
include/llvm/IR/DiagnosticInfo.h
include/llvm/IR/DiagnosticPrinter.h
include/llvm/IR/Dominators.h
include/llvm/IR/Function.h
include/llvm/IR/GlobalAlias.h
include/llvm/IR/GlobalValue.h
include/llvm/IR/GlobalVariable.h
include/llvm/IR/Instructions.h
include/llvm/IR/LegacyPassManager.h
include/llvm/IR/LegacyPassManagers.h
include/llvm/IR/LegacyPassNameParser.h
include/llvm/Pass.h
lib/IR/AttributeImpl.h
lib/IR/ConstantsContext.h
lib/IR/IRPrintingPasses.cpp
lib/IR/LLVMContextImpl.h
lib/IR/LegacyPassManager.cpp
lib/IR/Metadata.cpp
lib/IR/Pass.cpp
lib/IR/Verifier.cpp

index 26bad1dd1f79fba9ab45d81485adb2b3fc5b7ce9..f03e3dd455370800233f874500cd30c1928d4235 100644 (file)
@@ -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) {}
index 448d82931a6e66e04033b69baeedaa106c548670..ed7a70f773ea1f1cc8385e7fa3e4c11656aac8c7 100644 (file)
@@ -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) {
index 9b99ce6cd783e4725729c2e56d8c03a585ec3d2a..de2a9d8b1a0cbc087a42aa40545729148dfe0253 100644 (file)
@@ -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) {
index 6177b7fe10a052a6db08bf489a40487760dcd329..411c781e01c5f7523f8b0259d22b98ef504d7d40 100644 (file)
@@ -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
 
index 550b634a24fd2887c7ceef3e043afddb24935e7b..987ff1944e337208988a672e5464eb03599ff10a 100644 (file)
@@ -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
index bba7ecdd2372d3cf5671d873c3bfa992ab6589cd..11208bb91740f6c9a7a1c86d8ef659d100e1705f 100644 (file)
@@ -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
index fec61a7ceaf1aa9b008504e64d9455ecce70f1da..81777af38696e69d8da3285098d29f7ad4bbd282 100644 (file)
@@ -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);
index 32108b153cd8bda4323a18655e7c2410a49a1f10..e490023db164cfabcb15e9b94691f41efb22609a 100644 (file)
@@ -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.
index 660092df3dee0b798a226c0877c576048c9fc94e..a82740f71009e812e9bcd6e00a2dd3bcf43cbeba 100644 (file)
@@ -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) {
index 24912d7d5c93f817a04e90e7f4ed802b59a42ac1..c249f878c4c4174fe98604a76313d6cf0a35cb4d 100644 (file)
@@ -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
index fa1436ec63247caa60fc3572e2d68490fc541f25..c967a6bca8b260de615ab53973f3ca9475b45830 100644 (file)
@@ -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
index 6116132e61184bcaf95784e2cb996a195cff5861..5c9dccd8b2f181e3c704ca926ac8b85a4f361b91 100644 (file)
@@ -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;
   }
 };
index b9c1d8b45c8caebd8800b68da1d52836e8a96ae4..1f6bbbcc0903af573ae43ab76753852a3fee5767 100644 (file)
@@ -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);
+  }
 };
 
 ///===----------------------------------------------------------------------===//
index bfe57724d7ba70585d17da3296e1a11d9ef22217..ff700cfe0af14f343ff9c0fb7c59c20ec022c71e 100644 (file)
@@ -235,17 +235,17 @@ public:
 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.
@@ -268,11 +268,11 @@ public:
   ///
   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) {}
@@ -295,18 +295,18 @@ public:
   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
@@ -331,7 +331,8 @@ public:
   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;
@@ -351,11 +352,10 @@ public:
   ///
   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
index ea954ac20329b30bd81f49c7a563d8a747b94d67..9f3fd3e606d387562f1047dabbc11f5e69f17507 100644 (file)
@@ -109,7 +109,7 @@ public:
 };
 
 class AlignAttributeImpl : public EnumAttributeImpl {
-  virtual void anchor();
+  void anchor() override;
   unsigned Align;
 
 public:
index 64f835b005a77c908e3dc742cb59fe00643b71c4..59b9d4d3c5ed0dd0050a127ee0480b1d0fdc88df 100644 (file)
@@ -32,7 +32,7 @@ struct ConstantTraits;
 /// 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
@@ -49,7 +49,7 @@ public:
 /// 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
@@ -70,7 +70,7 @@ public:
 /// 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
@@ -91,7 +91,7 @@ public:
 /// 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
@@ -112,7 +112,7 @@ public:
 /// 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
@@ -134,7 +134,7 @@ public:
 /// 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
@@ -159,7 +159,7 @@ public:
 /// 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
@@ -185,7 +185,7 @@ public:
 /// 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
@@ -212,7 +212,7 @@ public:
 /// 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:
@@ -233,7 +233,7 @@ 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
index 13336ba55b3e3d39390ec6f93695ae64091812e0..099c27cfa5c041cb80e32e6a78277212103e31c4 100644 (file)
@@ -49,12 +49,12 @@ public:
   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();
   }
 };
@@ -69,12 +69,12 @@ public:
       : 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();
   }
 };
@@ -89,12 +89,12 @@ public:
   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();
   }
 };
index 7a3cdb9e9d3544b3453a396318747a4e6ddb02a3..dc77d291f40c040d7940438daaa8a32e18a615d6 100644 (file)
@@ -225,9 +225,9 @@ public:
   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 {
index e384e08457103e5b0c4a7502964ef26bfd40cff6..7c5cc6893bca6f181bb30bdd3ac7fc82f0bf2239 100644 (file)
@@ -164,27 +164,27 @@ public:
 
   /// 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);
@@ -199,7 +199,7 @@ public:
     return BP;
   }
 
-  virtual PassManagerType getPassManagerType() const {
+  PassManagerType getPassManagerType() const override {
     return PMT_BasicBlockPassManager;
   }
 };
@@ -234,7 +234,8 @@ public:
   }
 
   /// 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);
   }
 
@@ -248,21 +249,21 @@ public:
 
   /// 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();
   }
 
@@ -303,7 +304,8 @@ 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 {
     return createPrintModulePass(O, Banner);
   }
 
@@ -323,29 +325,29 @@ public:
   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);
@@ -363,7 +365,7 @@ public:
     return static_cast<ModulePass *>(PassVector[N]);
   }
 
-  virtual PassManagerType getPassManagerType() const {
+  PassManagerType getPassManagerType() const override {
     return PMT_ModulePassManager;
   }
 
@@ -403,7 +405,8 @@ 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 {
     return createPrintModulePass(O, Banner);
   }
 
@@ -423,13 +426,13 @@ public:
   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;
   }
 
index f8a1776599ff4c574a23f5745a445110d5e067bb..c6107f5d8042cde1b8cadf1b8a712f077f8f3536 100644 (file)
@@ -78,8 +78,8 @@ public:
   /// 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.
 
index 06a5e9e378be4a130ede46240eb4829804d82714..e16c5b7dcb5c3e4a536bccdd84387ad721e9b501 100644 (file)
@@ -252,7 +252,7 @@ namespace {
     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());
     }
index 9b297756ceacc7211664f34cd5a97b40235ed904..03cfc42e332bcfb240f8fb276e36d46fbf597458 100644 (file)
@@ -2403,21 +2403,21 @@ struct VerifierLegacyPass : public FunctionPass {
     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();
   }
 };