diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/ExceptionDemo/ExceptionDemo.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter2/toy.cpp | 16 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter3/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter4/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter5/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter6/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter7/toy.cpp | 4 |
7 files changed, 33 insertions, 7 deletions
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 61b175091b7..c935206b811 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1577,9 +1577,11 @@ public: std::runtime_error::operator=(toCopy))); } - ~OurCppRunException (void) throw () {} + ~OurCppRunException (void) throw (); }; +OurCppRunException::~OurCppRunException() throw () {} + /// Throws foreign C++ exception. /// @param ignoreIt unused parameter that allows function to match implied diff --git a/examples/Kaleidoscope/Chapter2/toy.cpp b/examples/Kaleidoscope/Chapter2/toy.cpp index 2dc6711eed7..43eeb1c2cd2 100644 --- a/examples/Kaleidoscope/Chapter2/toy.cpp +++ b/examples/Kaleidoscope/Chapter2/toy.cpp @@ -79,28 +79,39 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { public: NumberExprAST(double val) {} + virtual ~NumberExprAST(); }; +NumberExprAST::~NumberExprAST() {} + /// VariableExprAST - Expression class for referencing a variable, like "a". class VariableExprAST : public ExprAST { std::string Name; public: VariableExprAST(const std::string &name) : Name(name) {} + virtual ~VariableExprAST(); }; +VariableExprAST::~VariableExprAST() {} + /// BinaryExprAST - Expression class for a binary operator. class BinaryExprAST : public ExprAST { public: BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) {} + virtual ~BinaryExprAST(); }; +BinaryExprAST::~BinaryExprAST() {} + /// CallExprAST - Expression class for function calls. class CallExprAST : public ExprAST { std::string Callee; @@ -108,8 +119,11 @@ class CallExprAST : public ExprAST { public: CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) : Callee(callee), Args(args) {} + virtual ~CallExprAST(); }; +CallExprAST::~CallExprAST() {} + /// PrototypeAST - This class represents the "prototype" for a function, /// which captures its name, and its argument names (thus implicitly the number /// of arguments the function takes). diff --git a/examples/Kaleidoscope/Chapter3/toy.cpp b/examples/Kaleidoscope/Chapter3/toy.cpp index 0fb64e3a54d..d25aa5d4d7f 100644 --- a/examples/Kaleidoscope/Chapter3/toy.cpp +++ b/examples/Kaleidoscope/Chapter3/toy.cpp @@ -84,10 +84,12 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); virtual Value *Codegen() = 0; }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index 0e41cc14ead..a52b5552a29 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -91,10 +91,12 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); virtual Value *Codegen() = 0; }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index d5a88a5a693..2770a380b7e 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/toy.cpp @@ -100,10 +100,12 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); virtual Value *Codegen() = 0; }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index 4d6a128cba2..2a0f212ef41 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -105,10 +105,12 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); virtual Value *Codegen() = 0; }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index beb0c0099cc..00628010d60 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -109,10 +109,12 @@ static int gettok() { /// ExprAST - Base class for all expression nodes. class ExprAST { public: - virtual ~ExprAST() {} + virtual ~ExprAST(); virtual Value *Codegen() = 0; }; +ExprAST::~ExprAST() {} + /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; |