Use 'override/final' instead of 'virtual' for overridden methods
[oota-llvm.git] / examples / Kaleidoscope / Chapter3 / toy.cpp
index 04a1e1ad70f22ef66304c0448240455e6e4a6bea..c60f76725fdb3909304a1da6f678e29683528f5f 100644 (file)
@@ -93,7 +93,7 @@ class NumberExprAST : public ExprAST {
   double Val;
 public:
   NumberExprAST(double val) : Val(val) {}
-  virtual Value *Codegen();
+  Value *Codegen() override;
 };
 
 /// VariableExprAST - Expression class for referencing a variable, like "a".
@@ -101,7 +101,7 @@ class VariableExprAST : public ExprAST {
   std::string Name;
 public:
   VariableExprAST(const std::string &name) : Name(name) {}
-  virtual Value *Codegen();
+  Value *Codegen() override;
 };
 
 /// BinaryExprAST - Expression class for a binary operator.
@@ -111,7 +111,7 @@ class BinaryExprAST : public ExprAST {
 public:
   BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) 
     : Op(op), LHS(lhs), RHS(rhs) {}
-  virtual Value *Codegen();
+  Value *Codegen() override;
 };
 
 /// CallExprAST - Expression class for function calls.
@@ -121,7 +121,7 @@ class CallExprAST : public ExprAST {
 public:
   CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
     : Callee(callee), Args(args) {}
-  virtual Value *Codegen();
+  Value *Codegen() override;
 };
 
 /// PrototypeAST - This class represents the "prototype" for a function,