Reviewers: plesner,

Message:
The version of gcc on my workstation and the one on the buildbot must be
different---I did not get these warnings locally.

Description:
Add virtual destructors to address a gcc warning.


Please review this at http://codereview.chromium.org/160449

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/cfg.h


Index: src/cfg.h
===================================================================
--- src/cfg.h   (revision 2596)
+++ src/cfg.h   (working copy)
@@ -38,6 +38,8 @@
  // generated.
  class Value : public ZoneObject {
   public:
+  virtual ~Value() {}
+
    virtual void ToRegister(MacroAssembler* masm, Register reg) = 0;

  #ifdef DEBUG
@@ -51,8 +53,10 @@
   public:
    explicit Constant(Handle<Object> handle) : handle_(handle) {}

-  virtual void ToRegister(MacroAssembler* masm, Register reg);
+  virtual ~Constant() {}

+  void ToRegister(MacroAssembler* masm, Register reg);
+
  #ifdef DEBUG
    void Print();
  #endif
@@ -67,6 +71,8 @@
  // be generated.
  class Instruction : public ZoneObject {
   public:
+  virtual ~Instruction() {}
+
    virtual void Compile(MacroAssembler* masm) = 0;

  #ifdef DEBUG
@@ -80,6 +86,8 @@
   public:
    explicit ReturnInstr(Value* value) : value_(value) {}

+  virtual ~ReturnInstr() {}
+
    void Compile(MacroAssembler* masm);

  #ifdef DEBUG
@@ -102,6 +110,8 @@
  #endif
    }

+  virtual ~CfgNode() {}
+
    bool is_marked() { return is_marked_; }

    static void Reset();
@@ -137,6 +147,8 @@
   public:
    InstructionBlock() : successor_(NULL), instructions_(4) {}

+  virtual ~InstructionBlock() {}
+
    static InstructionBlock* cast(CfgNode* node) {
      ASSERT(node->is_block());
      return reinterpret_cast<InstructionBlock*>(node);
@@ -172,6 +184,8 @@
   public:
    EntryNode(FunctionLiteral* fun, InstructionBlock* succ);

+  virtual ~EntryNode() {}
+
    void Unmark();

    void Compile(MacroAssembler* masm);
@@ -193,6 +207,8 @@
   public:
    explicit ExitNode(FunctionLiteral* fun);

+  virtual ~ExitNode() {}
+
    void Unmark();

    void Compile(MacroAssembler* masm);



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to