Opt compiler: Clean the use of `virtual` and `OVERRIDE`.

Change-Id: I806ec522b979334cee8f344fc95e8660c019160a
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 7f2ea02..b19c445 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -78,7 +78,7 @@
  public:
   explicit NullCheckSlowPathX86(HNullCheck* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     __ fs()->call(Address::Absolute(QUICK_ENTRYPOINT_OFFSET(kX86WordSize, pThrowNullPointer)));
     codegen->RecordPcInfo(instruction_, instruction_->GetDexPc());
@@ -93,7 +93,7 @@
  public:
   explicit DivZeroCheckSlowPathX86(HDivZeroCheck* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     __ fs()->call(Address::Absolute(QUICK_ENTRYPOINT_OFFSET(kX86WordSize, pThrowDivZero)));
     codegen->RecordPcInfo(instruction_, instruction_->GetDexPc());
@@ -108,7 +108,7 @@
  public:
   explicit DivRemMinusOneSlowPathX86(Register reg, bool is_div) : reg_(reg), is_div_(is_div) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     if (is_div_) {
       __ negl(reg_);
@@ -133,7 +133,7 @@
         index_location_(index_location),
         length_location_(length_location) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
     __ Bind(GetEntryLabel());
     // We're moving two locations to locations that could overlap, so we need a parallel
@@ -161,7 +161,7 @@
   explicit SuspendCheckSlowPathX86(HSuspendCheck* instruction, HBasicBlock* successor)
       : instruction_(instruction), successor_(successor) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
     __ Bind(GetEntryLabel());
     codegen->SaveLiveRegisters(instruction_->GetLocations());
@@ -192,7 +192,7 @@
  public:
   explicit LoadStringSlowPathX86(HLoadString* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
 
@@ -227,7 +227,7 @@
     DCHECK(at->IsLoadClass() || at->IsClinitCheck());
   }
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = at_->GetLocations();
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
     __ Bind(GetEntryLabel());
@@ -280,7 +280,7 @@
         object_class_(object_class),
         dex_pc_(dex_pc) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(instruction_->IsCheckCast()
            || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index e7e6fff..07ba95d 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -68,7 +68,7 @@
  public:
   explicit NullCheckSlowPathX86_64(HNullCheck* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     __ gs()->call(
         Address::Absolute(QUICK_ENTRYPOINT_OFFSET(kX86_64WordSize, pThrowNullPointer), true));
@@ -84,7 +84,7 @@
  public:
   explicit DivZeroCheckSlowPathX86_64(HDivZeroCheck* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     __ gs()->call(
         Address::Absolute(QUICK_ENTRYPOINT_OFFSET(kX86_64WordSize, pThrowDivZero), true));
@@ -101,7 +101,7 @@
   explicit DivRemMinusOneSlowPathX86_64(Register reg, Primitive::Type type, bool is_div)
       : cpu_reg_(CpuRegister(reg)), type_(type), is_div_(is_div) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     if (type_ == Primitive::kPrimInt) {
       if (is_div_) {
@@ -133,7 +133,7 @@
   explicit SuspendCheckSlowPathX86_64(HSuspendCheck* instruction, HBasicBlock* successor)
       : instruction_(instruction), successor_(successor) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     CodeGeneratorX86_64* x64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
     __ Bind(GetEntryLabel());
     codegen->SaveLiveRegisters(instruction_->GetLocations());
@@ -169,7 +169,7 @@
         index_location_(index_location),
         length_location_(length_location) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     __ Bind(GetEntryLabel());
     // We're moving two locations to locations that could overlap, so we need a parallel
     // move resolver.
@@ -202,7 +202,7 @@
     DCHECK(at->IsLoadClass() || at->IsClinitCheck());
   }
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = at_->GetLocations();
     CodeGeneratorX86_64* x64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
     __ Bind(GetEntryLabel());
@@ -249,7 +249,7 @@
  public:
   explicit LoadStringSlowPathX86_64(HLoadString* instruction) : instruction_(instruction) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
 
@@ -286,7 +286,7 @@
         object_class_(object_class),
         dex_pc_(dex_pc) {}
 
-  virtual void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
+  void EmitNativeCode(CodeGenerator* codegen) OVERRIDE {
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(instruction_->IsCheckCast()
            || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 6945ff0..4409a4e 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -669,14 +669,14 @@
 #undef FORWARD_DECLARATION
 
 #define DECLARE_INSTRUCTION(type)                                       \
-  virtual InstructionKind GetKind() const { return k##type; }           \
-  virtual const char* DebugName() const { return #type; }               \
-  virtual const H##type* As##type() const OVERRIDE { return this; }     \
-  virtual H##type* As##type() OVERRIDE { return this; }                 \
-  virtual bool InstructionTypeEquals(HInstruction* other) const {       \
+  InstructionKind GetKind() const OVERRIDE { return k##type; }          \
+  const char* DebugName() const OVERRIDE { return #type; }              \
+  const H##type* As##type() const OVERRIDE { return this; }             \
+  H##type* As##type() OVERRIDE { return this; }                         \
+  bool InstructionTypeEquals(HInstruction* other) const OVERRIDE {      \
     return other->Is##type();                                           \
   }                                                                     \
-  virtual void Accept(HGraphVisitor* visitor)
+  void Accept(HGraphVisitor* visitor) OVERRIDE
 
 template <typename T> class HUseList;
 
@@ -1351,7 +1351,7 @@
       : HInstruction(side_effects), inputs_() {}
   virtual ~HTemplateInstruction() {}
 
-  virtual size_t InputCount() const { return N; }
+  size_t InputCount() const OVERRIDE { return N; }
 
  protected:
   const HUserRecord<HInstruction*> InputRecordAt(size_t i) const OVERRIDE { return inputs_[i]; }
@@ -1373,7 +1373,7 @@
       : HTemplateInstruction<N>(side_effects), type_(type) {}
   virtual ~HExpression() {}
 
-  virtual Primitive::Type GetType() const { return type_; }
+  Primitive::Type GetType() const OVERRIDE { return type_; }
 
  protected:
   Primitive::Type type_;
@@ -1385,7 +1385,7 @@
  public:
   HReturnVoid() : HTemplateInstruction(SideEffects::None()) {}
 
-  virtual bool IsControlFlow() const { return true; }
+  bool IsControlFlow() const OVERRIDE { return true; }
 
   DECLARE_INSTRUCTION(ReturnVoid);
 
@@ -1401,7 +1401,7 @@
     SetRawInputAt(0, value);
   }
 
-  virtual bool IsControlFlow() const { return true; }
+  bool IsControlFlow() const OVERRIDE { return true; }
 
   DECLARE_INSTRUCTION(Return);
 
@@ -1416,7 +1416,7 @@
  public:
   HExit() : HTemplateInstruction(SideEffects::None()) {}
 
-  virtual bool IsControlFlow() const { return true; }
+  bool IsControlFlow() const OVERRIDE { return true; }
 
   DECLARE_INSTRUCTION(Exit);
 
@@ -1478,8 +1478,8 @@
   HInstruction* GetInput() const { return InputAt(0); }
   Primitive::Type GetResultType() const { return GetType(); }
 
-  virtual bool CanBeMoved() const { return true; }
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool CanBeMoved() const OVERRIDE { return true; }
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     UNUSED(other);
     return true;
   }
@@ -1546,8 +1546,8 @@
     }
   }
 
-  virtual bool CanBeMoved() const { return true; }
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool CanBeMoved() const OVERRIDE { return true; }
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     UNUSED(other);
     return true;
   }
@@ -1600,16 +1600,16 @@
 
   bool IsCommutative() const OVERRIDE { return true; }
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x == y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x == y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(Equal);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondEQ;
   }
 
@@ -1624,16 +1624,16 @@
 
   bool IsCommutative() const OVERRIDE { return true; }
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x != y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x != y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(NotEqual);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondNE;
   }
 
@@ -1646,16 +1646,16 @@
   HLessThan(HInstruction* first, HInstruction* second)
       : HCondition(first, second) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x < y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x < y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(LessThan);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondLT;
   }
 
@@ -1668,16 +1668,16 @@
   HLessThanOrEqual(HInstruction* first, HInstruction* second)
       : HCondition(first, second) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x <= y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x <= y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(LessThanOrEqual);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondLE;
   }
 
@@ -1690,16 +1690,16 @@
   HGreaterThan(HInstruction* first, HInstruction* second)
       : HCondition(first, second) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x > y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x > y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(GreaterThan);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondGT;
   }
 
@@ -1712,16 +1712,16 @@
   HGreaterThanOrEqual(HInstruction* first, HInstruction* second)
       : HCondition(first, second) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x >= y ? 1 : 0;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x >= y ? 1 : 0;
   }
 
   DECLARE_INSTRUCTION(GreaterThanOrEqual);
 
-  virtual IfCondition GetCondition() const {
+  IfCondition GetCondition() const OVERRIDE {
     return kCondGE;
   }
 
@@ -1830,7 +1830,7 @@
  public:
   explicit HConstant(Primitive::Type type) : HExpression(type, SideEffects::None()) {}
 
-  virtual bool CanBeMoved() const { return true; }
+  bool CanBeMoved() const OVERRIDE { return true; }
 
   DECLARE_INSTRUCTION(Constant);
 
@@ -1844,12 +1844,12 @@
 
   float GetValue() const { return value_; }
 
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     return bit_cast<float, int32_t>(other->AsFloatConstant()->value_) ==
         bit_cast<float, int32_t>(value_);
   }
 
-  virtual size_t ComputeHashCode() const { return static_cast<size_t>(GetValue()); }
+  size_t ComputeHashCode() const OVERRIDE { return static_cast<size_t>(GetValue()); }
 
   DECLARE_INSTRUCTION(FloatConstant);
 
@@ -1865,12 +1865,12 @@
 
   double GetValue() const { return value_; }
 
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     return bit_cast<double, int64_t>(other->AsDoubleConstant()->value_) ==
         bit_cast<double, int64_t>(value_);
   }
 
-  virtual size_t ComputeHashCode() const { return static_cast<size_t>(GetValue()); }
+  size_t ComputeHashCode() const OVERRIDE { return static_cast<size_t>(GetValue()); }
 
   DECLARE_INSTRUCTION(DoubleConstant);
 
@@ -1931,11 +1931,11 @@
 
   int64_t GetValue() const { return value_; }
 
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     return other->AsLongConstant()->value_ == value_;
   }
 
-  virtual size_t ComputeHashCode() const { return static_cast<size_t>(GetValue()); }
+  size_t ComputeHashCode() const OVERRIDE { return static_cast<size_t>(GetValue()); }
 
   DECLARE_INSTRUCTION(LongConstant);
 
@@ -1957,7 +1957,7 @@
 
 class HInvoke : public HInstruction {
  public:
-  virtual size_t InputCount() const { return inputs_.Size(); }
+  size_t InputCount() const OVERRIDE { return inputs_.Size(); }
 
   // Runtime needs to walk the stack, so Dex -> Dex calls need to
   // know their environment.
@@ -1967,7 +1967,7 @@
     SetRawInputAt(index, argument);
   }
 
-  virtual Primitive::Type GetType() const { return return_type_; }
+  Primitive::Type GetType() const OVERRIDE { return return_type_; }
 
   uint32_t GetDexPc() const { return dex_pc_; }
 
@@ -2135,8 +2135,8 @@
   explicit HNeg(Primitive::Type result_type, HInstruction* input)
       : HUnaryOperation(result_type, input) {}
 
-  virtual int32_t Evaluate(int32_t x) const OVERRIDE { return -x; }
-  virtual int64_t Evaluate(int64_t x) const OVERRIDE { return -x; }
+  int32_t Evaluate(int32_t x) const OVERRIDE { return -x; }
+  int64_t Evaluate(int64_t x) const OVERRIDE { return -x; }
 
   DECLARE_INSTRUCTION(Neg);
 
@@ -2182,12 +2182,12 @@
   HAdd(Primitive::Type result_type, HInstruction* left, HInstruction* right)
       : HBinaryOperation(result_type, left, right) {}
 
-  virtual bool IsCommutative() const OVERRIDE { return true; }
+  bool IsCommutative() const OVERRIDE { return true; }
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x + y;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x + y;
   }
 
@@ -2202,10 +2202,10 @@
   HSub(Primitive::Type result_type, HInstruction* left, HInstruction* right)
       : HBinaryOperation(result_type, left, right) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     return x - y;
   }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     return x - y;
   }
 
@@ -2220,10 +2220,10 @@
   HMul(Primitive::Type result_type, HInstruction* left, HInstruction* right)
       : HBinaryOperation(result_type, left, right) {}
 
-  virtual bool IsCommutative() const OVERRIDE { return true; }
+  bool IsCommutative() const OVERRIDE { return true; }
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const { return x * y; }
-  virtual int64_t Evaluate(int64_t x, int64_t y) const { return x * y; }
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE { return x * y; }
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE { return x * y; }
 
   DECLARE_INSTRUCTION(Mul);
 
@@ -2236,14 +2236,14 @@
   HDiv(Primitive::Type result_type, HInstruction* left, HInstruction* right, uint32_t dex_pc)
       : HBinaryOperation(result_type, left, right), dex_pc_(dex_pc) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     // Our graph structure ensures we never have 0 for `y` during constant folding.
     DCHECK_NE(y, 0);
     // Special case -1 to avoid getting a SIGFPE on x86(_64).
     return (y == -1) ? -x : x / y;
   }
 
-  virtual int64_t Evaluate(int64_t x, int64_t y) const {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     DCHECK_NE(y, 0);
     // Special case -1 to avoid getting a SIGFPE on x86(_64).
     return (y == -1) ? -x : x / y;
@@ -2264,13 +2264,13 @@
   HRem(Primitive::Type result_type, HInstruction* left, HInstruction* right, uint32_t dex_pc)
       : HBinaryOperation(result_type, left, right), dex_pc_(dex_pc) {}
 
-  virtual int32_t Evaluate(int32_t x, int32_t y) const {
+  int32_t Evaluate(int32_t x, int32_t y) const OVERRIDE {
     DCHECK_NE(y, 0);
     // Special case -1 to avoid getting a SIGFPE on x86(_64).
     return (y == -1) ? 0 : x % y;
   }
 
-  virtual int64_t Evaluate(int64_t x, int64_t y) const {
+  int64_t Evaluate(int64_t x, int64_t y) const OVERRIDE {
     DCHECK_NE(y, 0);
     // Special case -1 to avoid getting a SIGFPE on x86(_64).
     return (y == -1) ? 0 : x % y;
@@ -2441,14 +2441,14 @@
   explicit HNot(Primitive::Type result_type, HInstruction* input)
       : HUnaryOperation(result_type, input) {}
 
-  virtual bool CanBeMoved() const { return true; }
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool CanBeMoved() const OVERRIDE { return true; }
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     UNUSED(other);
     return true;
   }
 
-  virtual int32_t Evaluate(int32_t x) const OVERRIDE { return ~x; }
-  virtual int64_t Evaluate(int64_t x) const OVERRIDE { return ~x; }
+  int32_t Evaluate(int32_t x) const OVERRIDE { return ~x; }
+  int64_t Evaluate(int64_t x) const OVERRIDE { return ~x; }
 
   DECLARE_INSTRUCTION(Not);
 
@@ -2772,15 +2772,15 @@
     SetRawInputAt(1, length);
   }
 
-  virtual bool CanBeMoved() const { return true; }
-  virtual bool InstructionDataEquals(HInstruction* other) const {
+  bool CanBeMoved() const OVERRIDE { return true; }
+  bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
     UNUSED(other);
     return true;
   }
 
-  virtual bool NeedsEnvironment() const { return true; }
+  bool NeedsEnvironment() const OVERRIDE { return true; }
 
-  virtual bool CanThrow() const { return true; }
+  bool CanThrow() const OVERRIDE { return true; }
 
   uint32_t GetDexPc() const { return dex_pc_; }
 
@@ -2824,7 +2824,7 @@
   explicit HSuspendCheck(uint32_t dex_pc)
       : HTemplateInstruction(SideEffects::None()), dex_pc_(dex_pc) {}
 
-  virtual bool NeedsEnvironment() const {
+  bool NeedsEnvironment() const OVERRIDE {
     return true;
   }
 
@@ -3363,7 +3363,7 @@
 
   // Visit functions that delegate to to super class.
 #define DECLARE_VISIT_INSTRUCTION(name, super)                                        \
-  virtual void Visit##name(H##name* instr) OVERRIDE { Visit##super(instr); }
+  void Visit##name(H##name* instr) OVERRIDE { Visit##super(instr); }
 
   FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
 
diff --git a/compiler/optimizing/parallel_move_test.cc b/compiler/optimizing/parallel_move_test.cc
index 44a3da2..817a44b 100644
--- a/compiler/optimizing/parallel_move_test.cc
+++ b/compiler/optimizing/parallel_move_test.cc
@@ -36,7 +36,7 @@
     }
   }
 
-  virtual void EmitMove(size_t index) {
+  void EmitMove(size_t index) OVERRIDE {
     MoveOperands* move = moves_.Get(index);
     if (!message_.str().empty()) {
       message_ << " ";
@@ -48,7 +48,7 @@
     message_ << ")";
   }
 
-  virtual void EmitSwap(size_t index) {
+  void EmitSwap(size_t index) OVERRIDE {
     MoveOperands* move = moves_.Get(index);
     if (!message_.str().empty()) {
       message_ << " ";
@@ -60,8 +60,8 @@
     message_ << ")";
   }
 
-  virtual void SpillScratch(int reg ATTRIBUTE_UNUSED) {}
-  virtual void RestoreScratch(int reg ATTRIBUTE_UNUSED) {}
+  void SpillScratch(int reg ATTRIBUTE_UNUSED) OVERRIDE {}
+  void RestoreScratch(int reg ATTRIBUTE_UNUSED) OVERRIDE {}
 
   std::string GetMessage() const {
     return  message_.str();
diff --git a/compiler/optimizing/prepare_for_register_allocation.h b/compiler/optimizing/prepare_for_register_allocation.h
index 0f697fb..c28507c 100644
--- a/compiler/optimizing/prepare_for_register_allocation.h
+++ b/compiler/optimizing/prepare_for_register_allocation.h
@@ -33,12 +33,12 @@
   void Run();
 
  private:
-  virtual void VisitNullCheck(HNullCheck* check) OVERRIDE;
-  virtual void VisitDivZeroCheck(HDivZeroCheck* check) OVERRIDE;
-  virtual void VisitBoundsCheck(HBoundsCheck* check) OVERRIDE;
-  virtual void VisitBoundType(HBoundType* bound_type) OVERRIDE;
-  virtual void VisitClinitCheck(HClinitCheck* check) OVERRIDE;
-  virtual void VisitCondition(HCondition* condition) OVERRIDE;
+  void VisitNullCheck(HNullCheck* check) OVERRIDE;
+  void VisitDivZeroCheck(HDivZeroCheck* check) OVERRIDE;
+  void VisitBoundsCheck(HBoundsCheck* check) OVERRIDE;
+  void VisitBoundType(HBoundType* bound_type) OVERRIDE;
+  void VisitClinitCheck(HClinitCheck* check) OVERRIDE;
+  void VisitCondition(HCondition* condition) OVERRIDE;
 
   DISALLOW_COPY_AND_ASSIGN(PrepareForRegisterAllocation);
 };
diff --git a/compiler/optimizing/pretty_printer.h b/compiler/optimizing/pretty_printer.h
index d2a21c8..934514e 100644
--- a/compiler/optimizing/pretty_printer.h
+++ b/compiler/optimizing/pretty_printer.h
@@ -32,7 +32,7 @@
     PrintString(": ");
   }
 
-  virtual void VisitInstruction(HInstruction* instruction) {
+  void VisitInstruction(HInstruction* instruction) OVERRIDE {
     PrintPreInstruction(instruction);
     PrintString(instruction->DebugName());
     PrintPostInstruction(instruction);
@@ -68,7 +68,7 @@
     PrintNewLine();
   }
 
-  virtual void VisitBasicBlock(HBasicBlock* block) {
+  void VisitBasicBlock(HBasicBlock* block) OVERRIDE {
     PrintString("BasicBlock ");
     PrintInt(block->GetBlockId());
     const GrowableArray<HBasicBlock*>& predecessors = block->GetPredecessors();
@@ -106,15 +106,15 @@
   explicit StringPrettyPrinter(HGraph* graph)
       : HPrettyPrinter(graph), str_(""), current_block_(nullptr) { }
 
-  virtual void PrintInt(int value) {
+  void PrintInt(int value) OVERRIDE {
     str_ += StringPrintf("%d", value);
   }
 
-  virtual void PrintString(const char* value) {
+  void PrintString(const char* value) OVERRIDE {
     str_ += value;
   }
 
-  virtual void PrintNewLine() {
+  void PrintNewLine() OVERRIDE {
     str_ += '\n';
   }
 
@@ -122,12 +122,12 @@
 
   std::string str() const { return str_; }
 
-  virtual void VisitBasicBlock(HBasicBlock* block) {
+  void VisitBasicBlock(HBasicBlock* block) OVERRIDE {
     current_block_ = block;
     HPrettyPrinter::VisitBasicBlock(block);
   }
 
-  virtual void VisitGoto(HGoto* gota) {
+  void VisitGoto(HGoto* gota) OVERRIDE {
     PrintString("  ");
     PrintInt(gota->GetId());
     PrintString(": Goto ");
diff --git a/compiler/optimizing/ssa_test.cc b/compiler/optimizing/ssa_test.cc
index 7fc1ec6..a05b38c9 100644
--- a/compiler/optimizing/ssa_test.cc
+++ b/compiler/optimizing/ssa_test.cc
@@ -32,15 +32,15 @@
  public:
   explicit SsaPrettyPrinter(HGraph* graph) : HPrettyPrinter(graph), str_("") {}
 
-  virtual void PrintInt(int value) {
+  void PrintInt(int value) OVERRIDE {
     str_ += StringPrintf("%d", value);
   }
 
-  virtual void PrintString(const char* value) {
+  void PrintString(const char* value) OVERRIDE {
     str_ += value;
   }
 
-  virtual void PrintNewLine() {
+  void PrintNewLine() OVERRIDE {
     str_ += '\n';
   }
 
@@ -48,7 +48,7 @@
 
   std::string str() const { return str_; }
 
-  virtual void VisitIntConstant(HIntConstant* constant) {
+  void VisitIntConstant(HIntConstant* constant) OVERRIDE {
     PrintPreInstruction(constant);
     str_ += constant->DebugName();
     str_ += " ";