[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203344
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 30185d7..4768e67 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -97,7 +97,7 @@
     return static_cast<char*>(RawMemory) + sizeof(GVMemoryBlock);
   }
 
-  virtual void deleted() {
+  void deleted() override {
     // We allocated with operator new and with some extra memory hanging off the
     // end, so don't just delete this.  I'm not sure if this is actually
     // required.
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
index af0a372..db3dead 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -360,17 +360,17 @@
   SimpleBindingMemoryManager(const SimpleBindingMMFunctions& Functions,
                              void *Opaque);
   virtual ~SimpleBindingMemoryManager();
-  
-  virtual uint8_t *allocateCodeSection(
-    uintptr_t Size, unsigned Alignment, unsigned SectionID,
-    StringRef SectionName);
 
-  virtual uint8_t *allocateDataSection(
-    uintptr_t Size, unsigned Alignment, unsigned SectionID,
-    StringRef SectionName, bool isReadOnly);
+  uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
+                               unsigned SectionID,
+                               StringRef SectionName) override;
 
-  virtual bool finalizeMemory(std::string *ErrMsg);
-  
+  uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
+                               unsigned SectionID, StringRef SectionName,
+                               bool isReadOnly) override;
+
+  bool finalizeMemory(std::string *ErrMsg) override;
+
 private:
   SimpleBindingMMFunctions Functions;
   void *Opaque;
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
index 4c13da0..2e93cae 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -112,11 +112,11 @@
 
   /// run - Start execution with the specified function and arguments.
   ///
-  virtual GenericValue runFunction(Function *F,
-                                   const std::vector<GenericValue> &ArgValues);
+  GenericValue runFunction(Function *F,
+                           const std::vector<GenericValue> &ArgValues) override;
 
-  virtual void *getPointerToNamedFunction(const std::string &Name,
-                                          bool AbortOnFailure = true) {
+  void *getPointerToNamedFunction(const std::string &Name,
+                                  bool AbortOnFailure = true) override {
     // FIXME: not implemented.
     return 0;
   }
@@ -124,13 +124,13 @@
   /// recompileAndRelinkFunction - For the interpreter, functions are always
   /// up-to-date.
   ///
-  virtual void *recompileAndRelinkFunction(Function *F) {
+  void *recompileAndRelinkFunction(Function *F) override {
     return getPointerToFunction(F);
   }
 
   /// freeMachineCodeForFunction - The interpreter does not generate any code.
   ///
-  void freeMachineCodeForFunction(Function *F) { }
+  void freeMachineCodeForFunction(Function *F) override { }
 
   // Methods used to execute code:
   // Place a call on the stack
@@ -212,8 +212,8 @@
   //
   void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF);
 
-  void *getPointerToFunction(Function *F) { return (void*)F; }
-  void *getPointerToBasicBlock(BasicBlock *BB) { return (void*)BB; }
+  void *getPointerToFunction(Function *F) override { return (void*)F; }
+  void *getPointerToBasicBlock(BasicBlock *BB) override { return (void*)BB; }
 
   void initializeExecutionEngine() { }
   void initializeExternalFunctions();
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index b271618..d3ad77b 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -450,9 +450,8 @@
     MachineCodeInfo *const MCI;
    public:
     MCIListener(MachineCodeInfo *mci) : MCI(mci) {}
-    virtual void NotifyFunctionEmitted(const Function &,
-                                       void *Code, size_t Size,
-                                       const EmittedFunctionDetails &) {
+    void NotifyFunctionEmitted(const Function &, void *Code, size_t Size,
+                               const EmittedFunctionDetails &) override {
       MCI->setAddress(Code);
       MCI->setSize(Size);
     }
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.h b/llvm/lib/ExecutionEngine/JIT/JIT.h
index 6af2b4a..b1b0768 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.h
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.h
@@ -106,16 +106,16 @@
                                       RM, CMM);
   }
 
-  virtual void addModule(Module *M);
+  void addModule(Module *M) override;
 
   /// removeModule - Remove a Module from the list of modules.  Returns true if
   /// M is found.
-  virtual bool removeModule(Module *M);
+  bool removeModule(Module *M) override;
 
   /// runFunction - Start execution with the specified function and arguments.
   ///
-  virtual GenericValue runFunction(Function *F,
-                                   const std::vector<GenericValue> &ArgValues);
+  GenericValue runFunction(Function *F,
+                           const std::vector<GenericValue> &ArgValues) override;
 
   /// getPointerToNamedFunction - This method returns the address of the
   /// specified function by using the MemoryManager. As such it is only
@@ -125,8 +125,8 @@
   /// found, this function silently returns a null pointer. Otherwise,
   /// it prints a message to stderr and aborts.
   ///
-  virtual void *getPointerToNamedFunction(const std::string &Name,
-                                          bool AbortOnFailure = true);
+  void *getPointerToNamedFunction(const std::string &Name,
+                                  bool AbortOnFailure = true) override;
 
   // CompilationCallback - Invoked the first time that a call site is found,
   // which causes lazy compilation of the target function.
@@ -136,7 +136,7 @@
   /// getPointerToFunction - This returns the address of the specified function,
   /// compiling it if necessary.
   ///
-  void *getPointerToFunction(Function *F);
+  void *getPointerToFunction(Function *F) override;
 
   /// addPointerToBasicBlock - Adds address of the specific basic block.
   void addPointerToBasicBlock(const BasicBlock *BB, void *Addr);
@@ -146,18 +146,18 @@
 
   /// getPointerToBasicBlock - This returns the address of the specified basic
   /// block, assuming function is compiled.
-  void *getPointerToBasicBlock(BasicBlock *BB);
+  void *getPointerToBasicBlock(BasicBlock *BB) override;
 
   /// getOrEmitGlobalVariable - Return the address of the specified global
   /// variable, possibly emitting it to memory if needed.  This is used by the
   /// Emitter.
-  void *getOrEmitGlobalVariable(const GlobalVariable *GV);
+  void *getOrEmitGlobalVariable(const GlobalVariable *GV) override;
 
   /// getPointerToFunctionOrStub - If the specified function has been
   /// code-gen'd, return a pointer to the function.  If not, compile it, or use
   /// a stub to implement lazy compilation if available.
   ///
-  void *getPointerToFunctionOrStub(Function *F);
+  void *getPointerToFunctionOrStub(Function *F) override;
 
   /// recompileAndRelinkFunction - This method is used to force a function
   /// which has already been compiled, to be compiled again, possibly
@@ -165,12 +165,12 @@
   /// with a branch to the new copy. If there was no old copy, this acts
   /// just like JIT::getPointerToFunction().
   ///
-  void *recompileAndRelinkFunction(Function *F);
+  void *recompileAndRelinkFunction(Function *F) override;
 
   /// freeMachineCodeForFunction - deallocate memory used to code-generate this
   /// Function.
   ///
-  void freeMachineCodeForFunction(Function *F);
+  void freeMachineCodeForFunction(Function *F) override;
 
   /// addPendingFunction - while jitting non-lazily, a called but non-codegen'd
   /// function was encountered.  Add it to a pending list to be processed after
@@ -189,12 +189,12 @@
                                     TargetMachine *TM);
 
   // Run the JIT on F and return information about the generated code
-  void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0);
+  void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0) override;
 
-  virtual void RegisterJITEventListener(JITEventListener *L);
-  virtual void UnregisterJITEventListener(JITEventListener *L);
+  void RegisterJITEventListener(JITEventListener *L) override;
+  void UnregisterJITEventListener(JITEventListener *L) override;
 
-  virtual TargetMachine *getTargetMachine() { return &TM; }
+  TargetMachine *getTargetMachine() override { return &TM; }
 
   /// These functions correspond to the methods on JITEventListener.  They
   /// iterate over the registered listeners and call the corresponding method on
@@ -220,7 +220,7 @@
 protected:
 
   /// getMemoryforGV - Allocate memory for a global variable.
-  virtual char* getMemoryForGV(const GlobalVariable* GV);
+  char* getMemoryForGV(const GlobalVariable* GV) override;
 
 };
 
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
index b0e48ca..4b2f012 100644
--- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -375,8 +375,8 @@
 
     JITResolver &getJITResolver() { return Resolver; }
 
-    virtual void startFunction(MachineFunction &F);
-    virtual bool finishFunction(MachineFunction &F);
+    void startFunction(MachineFunction &F) override;
+    bool finishFunction(MachineFunction &F) override;
 
     void emitConstantPool(MachineConstantPool *MCP);
     void initJumpTableInfo(MachineJumpTableInfo *MJTI);
@@ -386,24 +386,23 @@
                      unsigned StubSize, unsigned Alignment = 1);
     void startGVStub(void *Buffer, unsigned StubSize);
     void finishGVStub();
-    virtual void *allocIndirectGV(const GlobalValue *GV,
-                                  const uint8_t *Buffer, size_t Size,
-                                  unsigned Alignment);
+    void *allocIndirectGV(const GlobalValue *GV, const uint8_t *Buffer,
+                          size_t Size, unsigned Alignment) override;
 
     /// allocateSpace - Reserves space in the current block if any, or
     /// allocate a new one of the given size.
-    virtual void *allocateSpace(uintptr_t Size, unsigned Alignment);
+    void *allocateSpace(uintptr_t Size, unsigned Alignment) override;
 
     /// allocateGlobal - Allocate memory for a global.  Unlike allocateSpace,
     /// this method does not allocate memory in the current output buffer,
     /// because a global may live longer than the current function.
-    virtual void *allocateGlobal(uintptr_t Size, unsigned Alignment);
+    void *allocateGlobal(uintptr_t Size, unsigned Alignment) override;
 
-    virtual void addRelocation(const MachineRelocation &MR) {
+    void addRelocation(const MachineRelocation &MR) override {
       Relocations.push_back(MR);
     }
 
-    virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) {
+    void StartMachineBasicBlock(MachineBasicBlock *MBB) override {
       if (MBBLocations.size() <= (unsigned)MBB->getNumber())
         MBBLocations.resize((MBB->getNumber()+1)*2);
       MBBLocations[MBB->getNumber()] = getCurrentPCValue();
@@ -414,10 +413,11 @@
                    << (void*) getCurrentPCValue() << "]\n");
     }
 
-    virtual uintptr_t getConstantPoolEntryAddress(unsigned Entry) const;
-    virtual uintptr_t getJumpTableEntryAddress(unsigned Entry) const;
+    uintptr_t getConstantPoolEntryAddress(unsigned Entry) const override;
+    uintptr_t getJumpTableEntryAddress(unsigned Entry) const override;
 
-    virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const{
+    uintptr_t
+    getMachineBasicBlockAddress(MachineBasicBlock *MBB) const override {
       assert(MBBLocations.size() > (unsigned)MBB->getNumber() &&
              MBBLocations[MBB->getNumber()] && "MBB not emitted!");
       return MBBLocations[MBB->getNumber()];
@@ -432,22 +432,22 @@
     /// function body.
     void deallocateMemForFunction(const Function *F);
 
-    virtual void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn);
+    void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn) override;
 
-    virtual void emitLabel(MCSymbol *Label) {
+    void emitLabel(MCSymbol *Label) override {
       LabelLocations[Label] = getCurrentPCValue();
     }
 
-    virtual DenseMap<MCSymbol*, uintptr_t> *getLabelLocations() {
+    DenseMap<MCSymbol*, uintptr_t> *getLabelLocations() override {
       return &LabelLocations;
     }
 
-    virtual uintptr_t getLabelAddress(MCSymbol *Label) const {
+    uintptr_t getLabelAddress(MCSymbol *Label) const override {
       assert(LabelLocations.count(Label) && "Label not emitted!");
       return LabelLocations.find(Label)->second;
     }
 
-    virtual void setModuleInfo(MachineModuleInfo* Info) {
+    void setModuleInfo(MachineModuleInfo* Info) override {
       MMI = Info;
     }
 
diff --git a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index f58d31b..6ae7383 100644
--- a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -274,8 +274,8 @@
   public:
     JITSlabAllocator(DefaultJITMemoryManager &jmm) : JMM(jmm) { }
     virtual ~JITSlabAllocator() { }
-    virtual MemSlab *Allocate(size_t Size);
-    virtual void Deallocate(MemSlab *Slab);
+    MemSlab *Allocate(size_t Size) override;
+    void Deallocate(MemSlab *Slab) override;
   };
 
   /// DefaultJITMemoryManager - Manage memory for the JIT code generation.
@@ -332,23 +332,24 @@
 
     /// getPointerToNamedFunction - This method returns the address of the
     /// specified function by using the dlsym function call.
-    virtual void *getPointerToNamedFunction(const std::string &Name,
-                                            bool AbortOnFailure = true);
+    void *getPointerToNamedFunction(const std::string &Name,
+                                    bool AbortOnFailure = true) override;
 
-    void AllocateGOT();
+    void AllocateGOT() override;
 
     // Testing methods.
-    virtual bool CheckInvariants(std::string &ErrorStr);
-    size_t GetDefaultCodeSlabSize() { return DefaultCodeSlabSize; }
-    size_t GetDefaultDataSlabSize() { return DefaultSlabSize; }
-    size_t GetDefaultStubSlabSize() { return DefaultSlabSize; }
-    unsigned GetNumCodeSlabs() { return CodeSlabs.size(); }
-    unsigned GetNumDataSlabs() { return DataAllocator.GetNumSlabs(); }
-    unsigned GetNumStubSlabs() { return StubAllocator.GetNumSlabs(); }
+    bool CheckInvariants(std::string &ErrorStr) override;
+    size_t GetDefaultCodeSlabSize() override { return DefaultCodeSlabSize; }
+    size_t GetDefaultDataSlabSize() override { return DefaultSlabSize; }
+    size_t GetDefaultStubSlabSize() override { return DefaultSlabSize; }
+    unsigned GetNumCodeSlabs() override { return CodeSlabs.size(); }
+    unsigned GetNumDataSlabs() override { return DataAllocator.GetNumSlabs(); }
+    unsigned GetNumStubSlabs() override { return StubAllocator.GetNumSlabs(); }
 
     /// startFunctionBody - When a function starts, allocate a block of free
     /// executable memory, returning a pointer to it and its actual size.
-    uint8_t *startFunctionBody(const Function *F, uintptr_t &ActualSize) {
+    uint8_t *startFunctionBody(const Function *F,
+                               uintptr_t &ActualSize) override {
 
       FreeRangeHeader* candidateBlock = FreeMemoryList;
       FreeRangeHeader* head = FreeMemoryList;
@@ -422,7 +423,7 @@
     /// endFunctionBody - The function F is now allocated, and takes the memory
     /// in the range [FunctionStart,FunctionEnd).
     void endFunctionBody(const Function *F, uint8_t *FunctionStart,
-                         uint8_t *FunctionEnd) {
+                         uint8_t *FunctionEnd) override {
       assert(FunctionEnd > FunctionStart);
       assert(FunctionStart == (uint8_t *)(CurBlock+1) &&
              "Mismatched function start/end!");
@@ -435,7 +436,7 @@
 
     /// allocateSpace - Allocate a memory block of the given size.  This method
     /// cannot be called between calls to startFunctionBody and endFunctionBody.
-    uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) {
+    uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) override {
       CurBlock = FreeMemoryList;
       FreeMemoryList = FreeMemoryList->AllocateBlock();
 
@@ -453,18 +454,19 @@
 
     /// allocateStub - Allocate memory for a function stub.
     uint8_t *allocateStub(const GlobalValue* F, unsigned StubSize,
-                          unsigned Alignment) {
+                          unsigned Alignment) override {
       return (uint8_t*)StubAllocator.Allocate(StubSize, Alignment);
     }
 
     /// allocateGlobal - Allocate memory for a global.
-    uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) {
+    uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) override {
       return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
     }
 
     /// allocateCodeSection - Allocate memory for a code section.
     uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                 unsigned SectionID, StringRef SectionName) {
+                                 unsigned SectionID,
+                                 StringRef SectionName) override {
       // Grow the required block size to account for the block header
       Size += sizeof(*CurBlock);
 
@@ -511,15 +513,15 @@
     /// allocateDataSection - Allocate memory for a data section.
     uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
                                  unsigned SectionID, StringRef SectionName,
-                                 bool IsReadOnly) {
+                                 bool IsReadOnly) override {
       return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
     }
 
-    bool finalizeMemory(std::string *ErrMsg) {
+    bool finalizeMemory(std::string *ErrMsg) override {
       return false;
     }
 
-    uint8_t *getGOTBase() const {
+    uint8_t *getGOTBase() const override {
       return GOTBase;
     }
 
@@ -539,28 +541,26 @@
 
     /// deallocateFunctionBody - Deallocate all memory for the specified
     /// function body.
-    void deallocateFunctionBody(void *Body) {
+    void deallocateFunctionBody(void *Body) override {
       if (Body) deallocateBlock(Body);
     }
 
     /// setMemoryWritable - When code generation is in progress,
     /// the code pages may need permissions changed.
-    void setMemoryWritable()
-    {
+    void setMemoryWritable() override {
       for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i)
         sys::Memory::setWritable(CodeSlabs[i]);
     }
     /// setMemoryExecutable - When code generation is done and we're ready to
     /// start execution, the code pages may need permissions changed.
-    void setMemoryExecutable()
-    {
+    void setMemoryExecutable() override {
       for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i)
         sys::Memory::setExecutable(CodeSlabs[i]);
     }
 
     /// setPoisonMemory - Controls whether we write garbage over freed memory.
     ///
-    void setPoisonMemory(bool poison) {
+    void setPoisonMemory(bool poison) override {
       PoisonMemory = poison;
     }
   };
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
index 8fb7474..16a9f37 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -31,46 +31,47 @@
   LinkingMemoryManager(MCJIT *Parent, RTDyldMemoryManager *MM)
     : ParentEngine(Parent), ClientMM(MM) {}
 
-  virtual uint64_t getSymbolAddress(const std::string &Name);
+  uint64_t getSymbolAddress(const std::string &Name) override;
 
   // Functions deferred to client memory manager
-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, StringRef SectionName) {
+  uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
+                               unsigned SectionID,
+                               StringRef SectionName) override {
     return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName);
   }
 
-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, StringRef SectionName,
-                                       bool IsReadOnly) {
+  uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
+                               unsigned SectionID, StringRef SectionName,
+                               bool IsReadOnly) override {
     return ClientMM->allocateDataSection(Size, Alignment,
                                          SectionID, SectionName, IsReadOnly);
   }
-  
-  virtual void reserveAllocationSpace(
-    uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) {
+
+  void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO,
+                              uintptr_t DataSizeRW) override {
     return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW);
   }
-  
-  virtual bool needsToReserveAllocationSpace() {
+
+  bool needsToReserveAllocationSpace() override {
     return ClientMM->needsToReserveAllocationSpace();
   }
 
-  virtual void notifyObjectLoaded(ExecutionEngine *EE,
-                                  const ObjectImage *Obj) {
+  void notifyObjectLoaded(ExecutionEngine *EE,
+                          const ObjectImage *Obj) override {
     ClientMM->notifyObjectLoaded(EE, Obj);
   }
 
-  virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
+  void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
+                        size_t Size) override {
     ClientMM->registerEHFrames(Addr, LoadAddr, Size);
   }
 
-  virtual void deregisterEHFrames(uint8_t *Addr,
-                                  uint64_t LoadAddr,
-                                  size_t Size) {
+  void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr,
+                          size_t Size) override {
     ClientMM->deregisterEHFrames(Addr, LoadAddr, Size);
   }
 
-  virtual bool finalizeMemory(std::string *ErrMsg = 0) {
+  bool finalizeMemory(std::string *ErrMsg = 0) override {
     return ClientMM->finalizeMemory(ErrMsg);
   }
 
@@ -237,20 +238,20 @@
 
   /// @name ExecutionEngine interface implementation
   /// @{
-  virtual void addModule(Module *M);
-  virtual void addObjectFile(object::ObjectFile *O);
-  virtual void addArchive(object::Archive *O);
-  virtual bool removeModule(Module *M);
+  void addModule(Module *M) override;
+  void addObjectFile(object::ObjectFile *O) override;
+  void addArchive(object::Archive *O) override;
+  bool removeModule(Module *M) override;
 
   /// FindFunctionNamed - Search all of the active modules to find the one that
   /// defines FnName.  This is very slow operation and shouldn't be used for
   /// general code.
-  virtual Function *FindFunctionNamed(const char *FnName);
+  Function *FindFunctionNamed(const char *FnName) override;
 
   /// Sets the object manager that MCJIT should use to avoid compilation.
-  virtual void setObjectCache(ObjectCache *manager);
+  void setObjectCache(ObjectCache *manager) override;
 
-  virtual void generateCodeForModule(Module *M);
+  void generateCodeForModule(Module *M) override;
 
   /// finalizeObject - ensure the module is fully processed and is usable.
   ///
@@ -261,7 +262,7 @@
   /// object.
   /// Is it OK to finalize a set of modules, add modules and finalize again.
   // FIXME: Do we really need both of these?
-  virtual void finalizeObject();
+  void finalizeObject() override;
   virtual void finalizeModule(Module *);
   void finalizeLoadedModules();
 
@@ -269,18 +270,18 @@
   /// the static constructors or destructors for a program.
   ///
   /// \param isDtors - Run the destructors instead of constructors.
-  void runStaticConstructorsDestructors(bool isDtors);
+  void runStaticConstructorsDestructors(bool isDtors) override;
 
-  virtual void *getPointerToBasicBlock(BasicBlock *BB);
+  void *getPointerToBasicBlock(BasicBlock *BB) override;
 
-  virtual void *getPointerToFunction(Function *F);
+  void *getPointerToFunction(Function *F) override;
 
-  virtual void *recompileAndRelinkFunction(Function *F);
+  void *recompileAndRelinkFunction(Function *F) override;
 
-  virtual void freeMachineCodeForFunction(Function *F);
+  void freeMachineCodeForFunction(Function *F) override;
 
-  virtual GenericValue runFunction(Function *F,
-                                   const std::vector<GenericValue> &ArgValues);
+  GenericValue runFunction(Function *F,
+                           const std::vector<GenericValue> &ArgValues) override;
 
   /// getPointerToNamedFunction - This method returns the address of the
   /// specified function by using the dlsym function call.  As such it is only
@@ -290,27 +291,27 @@
   /// found, this function silently returns a null pointer. Otherwise,
   /// it prints a message to stderr and aborts.
   ///
-  virtual void *getPointerToNamedFunction(const std::string &Name,
-                                          bool AbortOnFailure = true);
+  void *getPointerToNamedFunction(const std::string &Name,
+                                  bool AbortOnFailure = true) override;
 
   /// mapSectionAddress - map a section to its target address space value.
   /// Map the address of a JIT section as returned from the memory manager
   /// to the address in the target process as the running code will see it.
   /// This is the address which will be used for relocation resolution.
-  virtual void mapSectionAddress(const void *LocalAddress,
-                                 uint64_t TargetAddress) {
+  void mapSectionAddress(const void *LocalAddress,
+                         uint64_t TargetAddress) override {
     Dyld.mapSectionAddress(LocalAddress, TargetAddress);
   }
-  virtual void RegisterJITEventListener(JITEventListener *L);
-  virtual void UnregisterJITEventListener(JITEventListener *L);
+  void RegisterJITEventListener(JITEventListener *L) override;
+  void UnregisterJITEventListener(JITEventListener *L) override;
 
   // If successful, these function will implicitly finalize all loaded objects.
   // To get a function address within MCJIT without causing a finalize, use
   // getSymbolAddress.
-  virtual uint64_t getGlobalValueAddress(const std::string &Name);
-  virtual uint64_t getFunctionAddress(const std::string &Name);
+  uint64_t getGlobalValueAddress(const std::string &Name) override;
+  uint64_t getFunctionAddress(const std::string &Name) override;
 
-  virtual TargetMachine *getTargetMachine() { return TM; }
+  TargetMachine *getTargetMachine() override { return TM; }
 
   /// @}
   /// @name (Private) Registration Interfaces
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
index 5878e59..d5587b3 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
@@ -84,12 +84,12 @@
   /// Creates an entry in the JIT registry for the buffer @p Object,
   /// which must contain an object file in executable memory with any
   /// debug information for the debugger.
-  void registerObject(const ObjectBuffer &Object);
+  void registerObject(const ObjectBuffer &Object) override;
 
   /// Removes the internal registration of @p Object, and
   /// frees associated resources.
   /// Returns true if @p Object was found in ObjectBufferMap.
-  bool deregisterObject(const ObjectBuffer &Object);
+  bool deregisterObject(const ObjectBuffer &Object) override;
 
 private:
   /// Deregister the debug info for the given object file from the debugger
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h b/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
index f647b87..3693c69 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
@@ -27,7 +27,7 @@
 class ObjectImageCommon : public ObjectImage {
   ObjectImageCommon(); // = delete
   ObjectImageCommon(const ObjectImageCommon &other); // = delete
-  virtual void anchor();
+  void anchor() override;
 
 protected:
   object::ObjectFile *ObjFile;
@@ -51,33 +51,33 @@
   : ObjectImage(NULL), ObjFile(Input)  {}
   virtual ~ObjectImageCommon() { delete ObjFile; }
 
-  virtual object::symbol_iterator begin_symbols() const
-              { return ObjFile->symbol_begin(); }
-  virtual object::symbol_iterator end_symbols() const
-              { return ObjFile->symbol_end(); }
+  object::symbol_iterator begin_symbols() const override
+      { return ObjFile->symbol_begin(); }
+  object::symbol_iterator end_symbols() const override
+      { return ObjFile->symbol_end(); }
 
-  virtual object::section_iterator begin_sections() const
-              { return ObjFile->section_begin(); }
-  virtual object::section_iterator end_sections() const
-              { return ObjFile->section_end(); }
+  object::section_iterator begin_sections() const override
+      { return ObjFile->section_begin(); }
+  object::section_iterator end_sections() const override
+      { return ObjFile->section_end(); }
 
-  virtual /* Triple::ArchType */ unsigned getArch() const
-              { return ObjFile->getArch(); }
+  /* Triple::ArchType */ unsigned getArch() const override
+      { return ObjFile->getArch(); }
 
-  virtual StringRef getData() const { return ObjFile->getData(); }
+  StringRef getData() const override { return ObjFile->getData(); }
 
-  virtual object::ObjectFile* getObjectFile() const { return ObjFile; }
+  object::ObjectFile* getObjectFile() const override { return ObjFile; }
 
   // Subclasses can override these methods to update the image with loaded
   // addresses for sections and common symbols
-  virtual void updateSectionAddress(const object::SectionRef &Sec,
-                                    uint64_t Addr) {}
-  virtual void updateSymbolAddress(const object::SymbolRef &Sym, uint64_t Addr)
-              {}
+  void updateSectionAddress(const object::SectionRef &Sec,
+                            uint64_t Addr) override {}
+  void updateSymbolAddress(const object::SymbolRef &Sym,
+                           uint64_t Addr) override {}
 
   // Subclasses can override these methods to provide JIT debugging support
-  virtual void registerWithDebugger() {}
-  virtual void deregisterWithDebugger() {}
+  void registerWithDebugger() override {}
+  void deregisterWithDebugger() override {}
 };
 
 } // end namespace llvm
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 6ca7fd3..0a593e6 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -94,23 +94,19 @@
 
     // Subclasses can override these methods to update the image with loaded
     // addresses for sections and common symbols
-    virtual void updateSectionAddress(const SectionRef &Sec, uint64_t Addr)
-    {
+    void updateSectionAddress(const SectionRef &Sec, uint64_t Addr) override {
       DyldObj->updateSectionAddress(Sec, Addr);
     }
 
-    virtual void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr)
-    {
+    void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr) override {
       DyldObj->updateSymbolAddress(Sym, Addr);
     }
 
-    virtual void registerWithDebugger()
-    {
+    void registerWithDebugger() override {
       JITRegistrar::getGDBRegistrar().registerObject(*Buffer);
       Registered = true;
     }
-    virtual void deregisterWithDebugger()
-    {
+    void deregisterWithDebugger() override {
       JITRegistrar::getGDBRegistrar().deregisterObject(*Buffer);
     }
 };
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
index 2ed2957..707940e 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
@@ -82,7 +82,7 @@
                                 uint32_t Type,
                                 int64_t Addend);
 
-  unsigned getMaxStubSize() {
+  unsigned getMaxStubSize() override {
     if (Arch == Triple::aarch64)
       return 20; // movz; movk; movk; movk; br
     if (Arch == Triple::arm || Arch == Triple::thumb)
@@ -99,7 +99,7 @@
       return 0;
   }
 
-  unsigned getStubAlignment() {
+  unsigned getStubAlignment() override {
     if (Arch == Triple::systemz)
       return 8;
     else
@@ -114,7 +114,7 @@
   uint64_t findGOTEntry(uint64_t LoadAddr, uint64_t Offset);
   size_t getGOTEntrySize();
 
-  virtual void updateGOTEntries(StringRef Name, uint64_t Addr);
+  void updateGOTEntries(StringRef Name, uint64_t Addr) override;
 
   // Relocation entries for symbols whose position-independent offset is
   // updated in a global offset table.
@@ -132,20 +132,18 @@
   RuntimeDyldELF(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm)
                                           {}
 
-  virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value);
-  virtual void processRelocationRef(unsigned SectionID,
-                                    RelocationRef RelI,
-                                    ObjectImage &Obj,
-                                    ObjSectionToIDMap &ObjSectionToID,
-                                    const SymbolTableMap &Symbols,
-                                    StubMap &Stubs);
-  virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
-  virtual bool isCompatibleFile(const object::ObjectFile *Buffer) const;
-  virtual ObjectImage *createObjectImage(ObjectBuffer *InputBuffer);
-  virtual ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj);
-  virtual void registerEHFrames();
-  virtual void deregisterEHFrames();
-  virtual void finalizeLoad(ObjSectionToIDMap &SectionMap);
+  void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
+  void processRelocationRef(unsigned SectionID, RelocationRef RelI,
+                            ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
+                            const SymbolTableMap &Symbols,
+                            StubMap &Stubs) override;
+  bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
+  bool isCompatibleFile(const object::ObjectFile *Buffer) const override;
+  ObjectImage *createObjectImage(ObjectBuffer *InputBuffer) override;
+  ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj) override;
+  void registerEHFrames() override;
+  void deregisterEHFrames() override;
+  void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
   virtual ~RuntimeDyldELF();
 };
 
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
index d42e297..bddf379 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
@@ -55,7 +55,7 @@
                          bool isPCRel,
                          unsigned Size);
 
-  unsigned getMaxStubSize() {
+  unsigned getMaxStubSize() override {
     if (Arch == Triple::arm || Arch == Triple::thumb)
       return 8; // 32-bit instruction and 32-bit address
     else if (Arch == Triple::x86_64)
@@ -64,7 +64,7 @@
       return 0;
   }
 
-  unsigned getStubAlignment() {
+  unsigned getStubAlignment() override {
     return 1;
   }
 
@@ -86,17 +86,15 @@
 public:
   RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
 
-  virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value);
-  virtual void processRelocationRef(unsigned SectionID,
-                                    RelocationRef RelI,
-                                    ObjectImage &Obj,
-                                    ObjSectionToIDMap &ObjSectionToID,
-                                    const SymbolTableMap &Symbols,
-                                    StubMap &Stubs);
-  virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
-  virtual bool isCompatibleFile(const object::ObjectFile *Obj) const;
-  virtual void registerEHFrames();
-  virtual void finalizeLoad(ObjSectionToIDMap &SectionMap);
+  void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
+  void processRelocationRef(unsigned SectionID, RelocationRef RelI,
+                            ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
+                            const SymbolTableMap &Symbols,
+                            StubMap &Stubs) override;
+  bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
+  bool isCompatibleFile(const object::ObjectFile *Obj) const override;
+  void registerEHFrames() override;
+  void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
 };
 
 } // end namespace llvm