summaryrefslogtreecommitdiff
path: root/examples/Kaleidoscope/Chapter4/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Kaleidoscope/Chapter4/toy.cpp')
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index 4d56c0f2df..27c3f4f22d 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -87,17 +87,14 @@ static int gettok() {
//===----------------------------------------------------------------------===//
// Abstract Syntax Tree (aka Parse Tree)
//===----------------------------------------------------------------------===//
-
+namespace {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
- virtual ~ExprAST();
+ virtual ~ExprAST() {}
virtual Value *Codegen() = 0;
};
-// Provide out-of-line definition to prevent weak vtable.
-ExprAST::~ExprAST() {}
-
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
double Val;
@@ -157,6 +154,7 @@ public:
Function *Codegen();
};
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
// Parser