Commit 1ec1f595 authored by Benedikt Meurer's avatar Benedikt Meurer

[turbofan] Cleanup use of virtual, OVERRIDE, FINAL.

Following the Google/Chromium coding style wrt. virtual, OVERRIDE and
FINAL specifications.

TEST=unittests
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/816453005

Cr-Commit-Position: refs/heads/master@{#25924}
parent eff42215
......@@ -114,7 +114,7 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
// Builder for stack-check guards.
Node* BuildStackCheck();
#define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE;
#define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE;
// Visiting functions for AST nodes make this an AstVisitor.
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
......@@ -347,9 +347,9 @@ class AstGraphBuilder::AstEffectContext FINAL : public AstContext {
public:
explicit AstEffectContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kEffect) {}
virtual ~AstEffectContext();
void ProduceValue(Node* value) OVERRIDE;
Node* ConsumeValue() OVERRIDE;
~AstEffectContext() FINAL;
void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() FINAL;
};
......@@ -358,9 +358,9 @@ class AstGraphBuilder::AstValueContext FINAL : public AstContext {
public:
explicit AstValueContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kValue) {}
virtual ~AstValueContext();
void ProduceValue(Node* value) OVERRIDE;
Node* ConsumeValue() OVERRIDE;
~AstValueContext() FINAL;
void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() FINAL;
};
......@@ -369,9 +369,9 @@ class AstGraphBuilder::AstTestContext FINAL : public AstContext {
public:
explicit AstTestContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kTest) {}
virtual ~AstTestContext();
void ProduceValue(Node* value) OVERRIDE;
Node* ConsumeValue() OVERRIDE;
~AstTestContext() FINAL;
void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() FINAL;
};
......
......@@ -21,9 +21,9 @@ class ChangeLowering FINAL : public Reducer {
public:
ChangeLowering(JSGraph* jsgraph, Linkage* linkage)
: jsgraph_(jsgraph), linkage_(linkage) {}
virtual ~ChangeLowering();
~ChangeLowering() FINAL;
Reduction Reduce(Node* node) OVERRIDE;
Reduction Reduce(Node* node) FINAL;
private:
Node* HeapNumberValueIndexConstant();
......
......@@ -86,10 +86,10 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
// ===========================================================================
// Interface used by the gap resolver to emit moves and swaps.
virtual void AssembleMove(InstructionOperand* source,
InstructionOperand* destination) OVERRIDE;
virtual void AssembleSwap(InstructionOperand* source,
InstructionOperand* destination) OVERRIDE;
void AssembleMove(InstructionOperand* source,
InstructionOperand* destination) FINAL;
void AssembleSwap(InstructionOperand* source,
InstructionOperand* destination) FINAL;
// ===========================================================================
// Deoptimization table construction
......
......@@ -40,7 +40,7 @@ class ControlBuilder {
// Tracks control flow for a conditional statement.
class IfBuilder : public ControlBuilder {
class IfBuilder FINAL : public ControlBuilder {
public:
explicit IfBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder),
......@@ -60,7 +60,7 @@ class IfBuilder : public ControlBuilder {
// Tracks control flow for an iteration statement.
class LoopBuilder : public ControlBuilder {
class LoopBuilder FINAL : public ControlBuilder {
public:
explicit LoopBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder),
......@@ -74,8 +74,8 @@ class LoopBuilder : public ControlBuilder {
void EndLoop();
// Primitive support for break and continue.
virtual void Continue();
virtual void Break();
void Continue() FINAL;
void Break() FINAL;
// Compound control command for conditional break.
void BreakUnless(Node* condition);
......@@ -88,7 +88,7 @@ class LoopBuilder : public ControlBuilder {
// Tracks control flow for a switch statement.
class SwitchBuilder : public ControlBuilder {
class SwitchBuilder FINAL : public ControlBuilder {
public:
explicit SwitchBuilder(StructuredGraphBuilder* builder, int case_count)
: ControlBuilder(builder),
......@@ -107,7 +107,7 @@ class SwitchBuilder : public ControlBuilder {
void EndSwitch();
// Primitive support for break.
virtual void Break();
void Break() FINAL;
// The number of cases within a switch is statically known.
size_t case_count() const { return body_environments_.size(); }
......@@ -121,7 +121,7 @@ class SwitchBuilder : public ControlBuilder {
// Tracks control flow for a block statement.
class BlockBuilder : public ControlBuilder {
class BlockBuilder FINAL : public ControlBuilder {
public:
explicit BlockBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder), break_environment_(NULL) {}
......@@ -131,13 +131,14 @@ class BlockBuilder : public ControlBuilder {
void EndBlock();
// Primitive support for break.
virtual void Break();
void Break() FINAL;
private:
Environment* break_environment_; // Environment after the block exits.
};
}
}
} // namespace v8::internal::compiler
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_CONTROL_BUILDERS_H_
......@@ -39,8 +39,9 @@ class GapResolver FINAL {
// Assembler used to emit moves and save registers.
Assembler* const assembler_;
};
}
}
} // namespace v8::internal::compiler
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_GAP_RESOLVER_H_
......@@ -86,7 +86,7 @@ class StructuredGraphBuilder : public GraphBuilder {
public:
StructuredGraphBuilder(Zone* zone, Graph* graph,
CommonOperatorBuilder* common);
virtual ~StructuredGraphBuilder() {}
~StructuredGraphBuilder() OVERRIDE {}
// Creates a new Phi node having {count} input values.
Node* NewPhi(int count, Node* input, Node* control);
......@@ -114,8 +114,8 @@ class StructuredGraphBuilder : public GraphBuilder {
// The following method creates a new node having the specified operator and
// ensures effect and control dependencies are wired up. The dependencies
// tracked by the environment might be mutated.
virtual Node* MakeNode(const Operator* op, int value_input_count,
Node** value_inputs, bool incomplete) FINAL;
Node* MakeNode(const Operator* op, int value_input_count, Node** value_inputs,
bool incomplete) FINAL;
Environment* environment() const { return environment_; }
void set_environment(Environment* env) { environment_ = env; }
......
......@@ -22,13 +22,14 @@ class CommonOperatorBuilder;
class MachineOperatorBuilder;
class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering : public Reducer {
class JSGenericLowering FINAL : public Reducer {
public:
JSGenericLowering(CompilationInfo* info, JSGraph* graph);
virtual ~JSGenericLowering() {}
~JSGenericLowering() FINAL {}
virtual Reduction Reduce(Node* node);
Reduction Reduce(Node* node) FINAL;
protected:
#define DECLARE_LOWER(x) void Lower##x(Node* node);
......
......@@ -48,7 +48,7 @@ class RawMachineAssembler : public GraphBuilder {
MachineType word = kMachPtr,
MachineOperatorBuilder::Flags flags =
MachineOperatorBuilder::Flag::kNoFlags);
virtual ~RawMachineAssembler() {}
~RawMachineAssembler() OVERRIDE {}
Isolate* isolate() const { return zone()->isolate(); }
Zone* zone() const { return graph()->zone(); }
......@@ -430,8 +430,8 @@ class RawMachineAssembler : public GraphBuilder {
Schedule* Export();
protected:
virtual Node* MakeNode(const Operator* op, int input_count, Node** inputs,
bool incomplete) FINAL;
Node* MakeNode(const Operator* op, int input_count, Node** inputs,
bool incomplete) FINAL;
bool ScheduleValid() { return schedule_ != NULL; }
......
......@@ -23,9 +23,9 @@ class MachineOperatorBuilder;
class SimplifiedOperatorReducer FINAL : public Reducer {
public:
explicit SimplifiedOperatorReducer(JSGraph* jsgraph);
virtual ~SimplifiedOperatorReducer();
~SimplifiedOperatorReducer() FINAL;
Reduction Reduce(Node* node) OVERRIDE;
Reduction Reduce(Node* node) FINAL;
private:
Reduction Change(Node* node, const Operator* op, Node* a);
......
......@@ -10,12 +10,12 @@ namespace v8 {
namespace internal {
namespace compiler {
class SourcePositionTable::Decorator : public GraphDecorator {
class SourcePositionTable::Decorator FINAL : public GraphDecorator {
public:
explicit Decorator(SourcePositionTable* source_positions)
: source_positions_(source_positions) {}
virtual void Decorate(Node* node) {
void Decorate(Node* node) FINAL {
DCHECK(!source_positions_->current_position_.IsInvalid());
source_positions_->table_.Set(node, source_positions_->current_position_);
}
......
......@@ -138,10 +138,10 @@ class LazyTypeCache FINAL : public ZoneObject {
};
class Typer::Decorator : public GraphDecorator {
class Typer::Decorator FINAL : public GraphDecorator {
public:
explicit Decorator(Typer* typer) : typer_(typer) {}
virtual void Decorate(Node* node);
void Decorate(Node* node) FINAL;
private:
Typer* typer_;
......
......@@ -24,7 +24,7 @@ namespace compiler {
class ChangeLoweringTest : public GraphTest {
public:
ChangeLoweringTest() : simplified_(zone()) {}
virtual ~ChangeLoweringTest() {}
~ChangeLoweringTest() OVERRIDE {}
virtual MachineType WordRepresentation() const = 0;
......@@ -111,9 +111,9 @@ class ChangeLoweringCommonTest
: public ChangeLoweringTest,
public ::testing::WithParamInterface<MachineType> {
public:
virtual ~ChangeLoweringCommonTest() {}
~ChangeLoweringCommonTest() OVERRIDE {}
virtual MachineType WordRepresentation() const FINAL { return GetParam(); }
MachineType WordRepresentation() const FINAL { return GetParam(); }
};
......@@ -176,8 +176,8 @@ INSTANTIATE_TEST_CASE_P(ChangeLoweringTest, ChangeLoweringCommonTest,
class ChangeLowering32Test : public ChangeLoweringTest {
public:
virtual ~ChangeLowering32Test() {}
virtual MachineType WordRepresentation() const FINAL { return kRepWord32; }
~ChangeLowering32Test() OVERRIDE {}
MachineType WordRepresentation() const FINAL { return kRepWord32; }
};
......@@ -334,8 +334,8 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeUint32ToTagged) {
class ChangeLowering64Test : public ChangeLoweringTest {
public:
virtual ~ChangeLowering64Test() {}
virtual MachineType WordRepresentation() const FINAL { return kRepWord64; }
~ChangeLowering64Test() OVERRIDE {}
MachineType WordRepresentation() const FINAL { return kRepWord64; }
};
......
......@@ -117,7 +117,7 @@ namespace {
class CommonOperatorTest : public TestWithZone {
public:
CommonOperatorTest() : common_(zone()) {}
virtual ~CommonOperatorTest() {}
~CommonOperatorTest() OVERRIDE {}
CommonOperatorBuilder* common() { return &common_; }
......
......@@ -30,7 +30,7 @@ using ::testing::Matcher;
class GraphTest : public TestWithContext, public TestWithZone {
public:
explicit GraphTest(int parameters = 1);
virtual ~GraphTest();
~GraphTest() OVERRIDE;
protected:
Node* Parameter(int32_t index);
......
......@@ -21,7 +21,7 @@ namespace compiler {
class InstructionSelectorTest : public TestWithContext, public TestWithZone {
public:
InstructionSelectorTest();
virtual ~InstructionSelectorTest();
~InstructionSelectorTest() OVERRIDE;
base::RandomNumberGenerator* rng() { return &rng_; }
......
......@@ -40,7 +40,7 @@ const StrictMode kStrictModes[] = {SLOPPY, STRICT};
class JSTypedLoweringTest : public TypedGraphTest {
public:
JSTypedLoweringTest() : TypedGraphTest(3), javascript_(zone()) {}
virtual ~JSTypedLoweringTest() {}
~JSTypedLoweringTest() OVERRIDE {}
protected:
Reduction Reduce(Node* node) {
......
......@@ -66,7 +66,7 @@ class MachineOperatorReducerTestWithParam
public:
explicit MachineOperatorReducerTestWithParam(int num_parameters = 2)
: MachineOperatorReducerTest(num_parameters) {}
virtual ~MachineOperatorReducerTestWithParam() {}
~MachineOperatorReducerTestWithParam() OVERRIDE {}
};
......
......@@ -19,7 +19,7 @@ namespace compiler {
class NodeMatcherTest : public GraphTest {
public:
NodeMatcherTest() : machine_(zone()) {}
virtual ~NodeMatcherTest() {}
~NodeMatcherTest() OVERRIDE {}
MachineOperatorBuilder* machine() { return &machine_; }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment